theme improvements

- force Light theme variant (temporary) to match the actual UI look
- define some colors and brushes in AppTheme to avoid repetition
- fix text color in AboutWindow
This commit is contained in:
2026-04-29 21:35:11 +03:00
parent a360013ac7
commit 0fa6e12422
3 changed files with 23 additions and 8 deletions

View File

@@ -15,7 +15,8 @@ public class AboutWindow : Window
this.MinWidth = 450;
this.MinHeight = 250;
this.Background = new SolidColorBrush(Color.Parse("#2328c4"));
this.Background = this.FindResource("KeyKeeperAboutWindowBackgroundBrush") as IBrush;
this.Foreground = this.FindResource("KeyKeeperAboutWindowForegroundBrush") as IBrush;
var AboutKeyKeeper = new TextBlock
{

View File

@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="KeyKeeper.App"
xmlns:local="using:KeyKeeper"
RequestedThemeVariant="Default">
RequestedThemeVariant="Light">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.DataTemplates>
@@ -16,4 +16,4 @@
<Setter Property="Icon" Value="/Assets/icon.ico"/>
</Style>
</Application.Styles>
</Application>
</Application>

View File

@@ -5,9 +5,24 @@
<Button Classes="" Content="contentъ"/>
</Border>
</Design.PreviewWith>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/FluentTheme.xaml"/>
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<Color x:Key="KeyKeeperAccentColor">#FF2328C4</Color>
<Color x:Key="KeyKeeperForeground">#00000000</Color>
<Color x:Key="KeyKeeperBackground">#FFFFFFFF</Color>
<SolidColorBrush x:Key="KeyKeeperAboutWindowBackgroundBrush" Color="{DynamicResource KeyKeeperAccentColor}" />
<SolidColorBrush x:Key="KeyKeeperAboutWindowForegroundBrush" Color="#FFFFFFFF" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Styles.Resources>
<Style Selector="Button:not(.dummy) /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="#cccccc" />
<Setter Property="Foreground" Value="#000000" />
@@ -20,7 +35,6 @@
<Setter Property="Background" Value="#444444" />
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style Selector="Button.accentSidebarButton /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="#00000000" />
<Setter Property="Foreground" Value="white" />
@@ -33,6 +47,6 @@
<Setter Property="CornerRadius" Value="9" />
<Setter Property="BorderBrush" Value="white" />
<Setter Property="Background" Value="white"/>
<Setter Property="Foreground" Value="#2328C4"/>
<Setter Property="Foreground" Value="{DynamicResource KeyKeeperAccentColor}"/>
</Style>
</Styles>
</Styles>