Skip to content

Commit

Permalink
Merge branch 'main' into niels9001/highcontrast-subtlebuttonfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe authored Nov 28, 2023
2 parents 92a075b + 79e3a7b commit 31b1e4d
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\WideTile.scale-200_altform-colorful_theme-light.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\WideTile.scale-400.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\WideTile.scale-400_altform-colorful_theme-light.png" />


<Content Include="$(MSBuildThisFileDirectory)LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CommunityToolkit.App.Shared/Helpers/IconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class IconHelper
IconElement? iconElement = null;
switch (category)
{
case ToolkitSampleCategory.Layouts: iconElement = new FontIcon() { Glyph = "\uF58C" }; break;
case ToolkitSampleCategory.Layouts: iconElement = new FontIcon() { Glyph = "\uE138" }; break;
case ToolkitSampleCategory.Controls: iconElement = new FontIcon() { Glyph = "\ue73a" }; break;
case ToolkitSampleCategory.Animations: iconElement = new FontIcon() { Glyph = "\ue945" }; break;
case ToolkitSampleCategory.Extensions: iconElement = new FontIcon() { Glyph = "\ue95f" }; break;
Expand Down
15 changes: 13 additions & 2 deletions CommunityToolkit.App.Shared/Helpers/NavigationViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,23 @@ public static class NavigationViewHelper
{
foreach (var metadata in sampleMetadata.OrderBy(meta => meta.Title))
{
yield return new MUXC.NavigationViewItem
MUXC.NavigationViewItem navItem = new MUXC.NavigationViewItem
{
Content = metadata.Title,
Icon = new BitmapIcon() { ShowAsMonochrome = false, UriSource = new Uri(IconHelper.GetIconPath(metadata.Icon)) },
Icon = new BitmapIcon()
{
ShowAsMonochrome = false,
UriSource = new Uri(IconHelper.GetIconPath(metadata.Icon))
},
Tag = metadata,
};

// Check if this is a Labs component
if (metadata.IsExperimental == true)
{
navItem.InfoBadge = new MUXC.InfoBadge() { Style = (Style)App.Current.Resources["LabsIconBadgeStyle"] };
}
yield return navItem;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Page x:Class="CommunityToolkit.App.Shared.Renderers.ToolkitDocumentationRenderer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand All @@ -17,6 +17,7 @@
mc:Ignorable="d wasm">

<Page.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<!-- Overriding the default Markdown styling to be inline with the default Windows typography / design guidelines -->
<Style TargetType="renderer:MarkdownTextBlock">
<Setter Property="Background" Value="Transparent" />
Expand Down Expand Up @@ -301,12 +302,15 @@
<muxc:InfoBar Title="Experimental"
Grid.Row="3"
Grid.ColumnSpan="2"
Margin="0,16,0,0"
Margin="0,16,0,16"
BorderBrush="Transparent"
IsClosable="False"
Visibility="Collapsed">
IsOpen="{x:Bind BoolFalseIfNull(Metadata.IsExperimental), Mode=OneWay}"
Message="This is component it part of Toolkit Labs and is considered experimental."
Severity="Warning">
<muxc:InfoBar.ActionButton>
<HyperlinkButton Content="Learn how you can use this experiment in your app"
NavigateUri="https://aka.ms/wct/wiki/previewpackages" />
<HyperlinkButton Content="Learn more about Toolkit Labs"
NavigateUri="https://aka.ms/toolkit/labs/windows" />
</muxc:InfoBar.ActionButton>
</muxc:InfoBar>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,6 @@ string e when e.Contains("Extensions") || e.Contains("Triggers") => "CommunityTo
};

public static bool IsProjectPathValid() => !string.IsNullOrWhiteSpace(ProjectUrl);

private bool BoolFalseIfNull(bool? value) => value ?? false;
}
24 changes: 24 additions & 0 deletions CommunityToolkit.App.Shared/Styles/Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,5 +433,29 @@
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
</Style>

<Style x:Key="LabsIconBadgeStyle"
TargetType="muxc:InfoBadge">
<Setter Property="Padding" Value="4,0,4,0" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:InfoBadge">
<ContentControl ContentTemplate="{StaticResource LabsLabelIconTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<DataTemplate x:Key="LabsLabelIconTemplate">
<Grid Padding="4,0,4,0"
Background="#FFC225"
CornerRadius="4">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="12"
FontWeight="SemiBold"
Foreground="Black"
Text="LABS" />
</Grid>
</DataTemplate>
</ResourceDictionary>
7 changes: 6 additions & 1 deletion CommunityToolkit.App.Shared/Styles/ItemTemplates.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary x:Class="CommunityToolkit.App.Shared.ItemTemplates"
<ResourceDictionary x:Class="CommunityToolkit.App.Shared.ItemTemplates"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:CommunityToolkit.App.Shared.Converters"
Expand Down Expand Up @@ -67,6 +67,11 @@
<BitmapImage UriSource="{Binding Icon, Converter={StaticResource stringToUriConverter}}" />
</Image.Source>
</Image>

<ContentControl HorizontalAlignment="Right"
VerticalAlignment="Bottom"
ContentTemplate="{StaticResource LabsLabelIconTemplate}"
Visibility="{Binding IsExperimental}" />
</Grid>

<RelativePanel Grid.Column="1"
Expand Down
28 changes: 0 additions & 28 deletions CommunityToolkit.App.Shared/WasmCSS/Fonts.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions MultiTarget/PackageReferences/Uno.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- All Uno-based project heads and MultiTarget-enabled library projects need to reference this file, while native (UWP/WinAppSdk) heads don't. -->
<ItemGroup Condition="'$(IsUno)' == 'true'">
<PackageReference Include="Uno.UI" Version="$(CommonUnoPackageVersion)" />
<PackageReference Include="Uno.Fonts.Fluent" Version="2.3.0" />
</ItemGroup>

<PropertyGroup Condition="'$(IsUno)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion ProjectHeads/App.Head.Wasm.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<ItemGroup>
<PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.6.0-dev.2" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.9.45" />
Expand Down
4 changes: 2 additions & 2 deletions ProjectHeads/Head.Uwp.props
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12"/>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14"/>
<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand All @@ -137,4 +137,4 @@
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
</Project>
</Project>
Binary file modified ProjectTemplate/samples/Assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 31b1e4d

Please sign in to comment.