Switch WinUI to the Windows 11 styles (#12241)

This commit is contained in:
PankajBhojwani
2022-01-27 05:26:38 -08:00
committed by GitHub
parent 1e47d7aca7
commit a13b207b6a
5 changed files with 40 additions and 21 deletions

View File

@@ -21,7 +21,7 @@
<ResourceDictionary.MergedDictionaries>
<!-- Include the MUX Controls resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
ControlsResourcesVersion="Version1" />
ControlsResourcesVersion="Version2" />
<ResourceDictionary>
<!--

View File

@@ -24,7 +24,8 @@
Grid.Row="0"
KeyUp="_KeyDownHandler" />
<StackPanel Grid.Row="1">
<StackPanel Grid.Row="1"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<mux:InfoBar x:Name="KeyboardServiceWarningInfoBar"
x:Load="False"
IsClosable="True"

View File

@@ -278,13 +278,14 @@
x:Uid="Profile_BackgroundImageAlignmentTopLeft"
Grid.Row="0"
Grid.Column="0"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Top (0x10) | Horizontal_Left (0x01) -->
<x:Int32>17</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xE744;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
@@ -297,13 +298,14 @@
x:Uid="Profile_BackgroundImageAlignmentTop"
Grid.Row="0"
Grid.Column="1"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Top (0x10) | Horizontal_Center (0x00) -->
<x:Int32>16</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xE745;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
@@ -316,13 +318,14 @@
x:Uid="Profile_BackgroundImageAlignmentTopRight"
Grid.Row="0"
Grid.Column="2"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Top (0x10) | Horizontal_Right (0x02) -->
<x:Int32>18</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xEA5F;"
RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
@@ -337,13 +340,14 @@
x:Uid="Profile_BackgroundImageAlignmentLeft"
Grid.Row="1"
Grid.Column="0"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Center (0x00) | Horizontal_Left (0x01) -->
<x:Int32>1</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xE746;" />
</ToggleButton.Content>
</ToggleButton>
@@ -351,13 +355,14 @@
x:Uid="Profile_BackgroundImageAlignmentCenter"
Grid.Row="1"
Grid.Column="1"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Center (0x00) | Horizontal_Center (0x00) -->
<x:Int32>0</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xF16E;" />
</ToggleButton.Content>
</ToggleButton>
@@ -365,13 +370,14 @@
x:Uid="Profile_BackgroundImageAlignmentRight"
Grid.Row="1"
Grid.Column="2"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Center (0x00) | Horizontal_Right (0x02) -->
<x:Int32>2</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xEA61;" />
</ToggleButton.Content>
</ToggleButton>
@@ -381,13 +387,14 @@
x:Uid="Profile_BackgroundImageAlignmentBottomLeft"
Grid.Row="2"
Grid.Column="0"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Bottom (0x20) | Horizontal_Left (0x01) -->
<x:Int32>33</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xE744;" />
</ToggleButton.Content>
</ToggleButton>
@@ -395,13 +402,14 @@
x:Uid="Profile_BackgroundImageAlignmentBottom"
Grid.Row="2"
Grid.Column="1"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Bottom (0x20) | Horizontal_Center (0x00) -->
<x:Int32>32</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xE745;" />
</ToggleButton.Content>
</ToggleButton>
@@ -409,13 +417,14 @@
x:Uid="Profile_BackgroundImageAlignmentBottomRight"
Grid.Row="2"
Grid.Column="2"
Click="BIAlignment_Click">
Click="BIAlignment_Click"
Style="{StaticResource BIAlignmentToggleButtonStyle}">
<ToggleButton.Tag>
<!-- ConvergedAlignment: Vertical_Top (0x20) | Horizontal_Right (0x02) -->
<x:Int32>34</x:Int32>
</ToggleButton.Tag>
<ToggleButton.Content>
<FontIcon FontFamily="Segoe MDL2 Assets"
<FontIcon FontFamily="Segoe Fluent Icons"
Glyph="&#xEA5F;" />
</ToggleButton.Content>
</ToggleButton>

View File

@@ -122,6 +122,7 @@
TargetType="Button">
<Setter Property="Height" Value="33" />
<Setter Property="Width" Value="33" />
<Setter Property="Padding" Value="5" />
</Style>
<Style x:Key="AccentBrowseButtonStyle"
@@ -138,6 +139,7 @@
<Setter Property="VerticalAlignment" Value="Bottom" />
<Setter Property="Height" Value="33" />
<Setter Property="Width" Value="33" />
<Setter Property="Padding" Value="5" />
</Style>
<Style x:Key="IconButtonTextBlockStyle"
@@ -145,6 +147,13 @@
<Setter Property="Margin" Value="10,0,0,0" />
</Style>
<Style x:Key="BIAlignmentToggleButtonStyle"
TargetType="ToggleButton">
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="40" />
<Setter Property="Padding" Value="8" />
</Style>
<!-- Slider-Related Styling -->
<Style x:Key="SliderValueLabelStyle"
TargetType="TextBlock">

View File

@@ -124,7 +124,7 @@
SettingOverrideSource="{x:Bind Profile.IconOverrideSource, Mode=OneWay}">
<StackPanel Orientation="Horizontal">
<TextBox x:Uid="Profile_IconBox"
FontFamily="Segoe UI, Segoe MDL2 Assets"
FontFamily="Segoe UI, Segoe Fluent Icons"
IsSpellCheckEnabled="False"
Style="{StaticResource TextBoxSettingStyle}"
Text="{x:Bind Profile.Icon, Mode=TwoWay}" />