Skip to content

Commit

Permalink
add theme-based dictionaries for brushes; move some MainWindow proper…
Browse files Browse the repository at this point in the history
…ties to the base Window style
  • Loading branch information
foglio1024 committed Jan 15, 2024
1 parent 0b409ae commit 9215bd4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
19 changes: 18 additions & 1 deletion src/client/Launcher/LauncherApplication.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,24 @@
<Application.Styles>
<FluentTheme />
<icons:MaterialIconStyles />

<StyleInclude Source="/Launcher/Styles/Window.axaml" />
</Application.Styles>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="WindowBackground" Color="#eee"/>
<SolidColorBrush x:Key="CloseButtonPointerOverBackground" Color="Red"/>
<SolidColorBrush x:Key="CloseButtonPressedBackground" Color="DarkRed"/>
<SolidColorBrush x:Key="DefaultButtonBackground" Color="#1000"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="WindowBackground" Color="#222"/>
<SolidColorBrush x:Key="CloseButtonPointerOverBackground" Color="DarkRed"/>
<SolidColorBrush x:Key="CloseButtonPressedBackground" Color="Red"/>
<SolidColorBrush x:Key="DefaultButtonBackground" Color="#1fff"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
4 changes: 3 additions & 1 deletion src/client/Launcher/Styles/Window.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<Setter Property="CanResize" Value="False" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="25" />
<Setter Property="Padding" Value="25, 50, 25, 25" />
<Setter Property="ExtendClientAreaChromeHints" Value="NoChrome" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="{DynamicResource WindowBackground}" />
</Style>
</Styles>
14 changes: 5 additions & 9 deletions src/client/Launcher/Windows/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
x:DataType="controllers:MainController"
Width="1280"
Height="720"
Padding="0"
CanResize="False"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome"
Background="#222222"
RequestedThemeVariant="Dark">
RequestedThemeVariant="Dark"
>
<Window.Styles>
<Style Selector="#CloseButton:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="DarkRed" />
<Setter Property="Background" Value="{DynamicResource CloseButtonPointerOverBackground}" />
</Style>
<Style Selector="#CloseButton:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="Red" />
<Setter Property="Background" Value="{DynamicResource CloseButtonPressedBackground}" />
</Style>
<Style Selector="Button">
<Setter Property="Background" Value="#1fff" />
<Setter Property="Background" Value="{DynamicResource DefaultButtonBackground}" />
<Setter Property="CornerRadius" Value="8" />
</Style>
</Window.Styles>
Expand Down

0 comments on commit 9215bd4

Please sign in to comment.