Background

This commit is contained in:
Niels Laute
2021-07-16 23:03:18 +02:00
parent 1302469e02
commit 37110dd470
3 changed files with 52 additions and 9 deletions

View File

@@ -7,7 +7,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" ControlsResourcesVersion="Version2" />
<ResourceDictionary Source="/Controls/KeyVisual/KeyVisual.xaml" />
<ResourceDictionary Source="/Styles/_FontSizes.xaml" />
<ResourceDictionary Source="/Styles/_Thickness.xaml" />
@@ -15,7 +15,32 @@
<ResourceDictionary Source="/Styles/TextBlock.xaml" />
<ResourceDictionary Source="/Styles/Button.xaml"/>
</ResourceDictionary.MergedDictionaries>
<converters:ModuleEnabledToOpacityConverter x:Key="ModuleEnabledToOpacityConverter"/>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="HomePageBackgroundBrush" Color="Transparent"/>
<SolidColorBrush x:Key="PageHeaderForegroundBrush" Color="White"/>
<StaticResource x:Key="ControlExampleDisplayBrush" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<Thickness x:Key="ControlExampleDisplayBorderThickness">0</Thickness>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="HomePageBackgroundBrush" Color="Transparent"/>
<SolidColorBrush x:Key="PageHeaderForegroundBrush" Color="White"/>
<StaticResource x:Key="ControlExampleDisplayBrush" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<Thickness x:Key="ControlExampleDisplayBorderThickness">0</Thickness>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="HomePageBackgroundBrush" Color="{ThemeResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="PageHeaderForegroundBrush" Color="White"/>
<SolidColorBrush x:Key="ControlExampleDisplayBrush" Color="{ThemeResource SystemColorWindowColor}" />
<Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>
</xaml:XamlApplication>

View File

@@ -372,18 +372,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\Page.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\TextBlock.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\_Colors.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\_FontSizes.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -10,8 +10,33 @@
xmlns:views="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
xmlns:i="using:Microsoft.Xaml.Interactivity"
winui:BackdropMaterial.ApplyToRootOrPageBackground="True"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="NavigationViewContentBackground" ResourceKey="LayerFillColorDefaultBrush"/>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<StaticResource x:Key="NavigationViewContentBackground" ResourceKey="LayerFillColorDefaultBrush"/>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="{ThemeResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="{ThemeResource SystemColorWindowColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="Loaded">
<ic:InvokeCommandAction Command="{x:Bind ViewModel.LoadedCommand}" />
@@ -21,6 +46,7 @@
<Grid>
<winui:NavigationView
x:Name="navigationView"
Background="{ThemeResource HomePageBackgroundBrush}"
IsBackButtonVisible="Collapsed"
IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}"