Skip to content

Commit fd66094

Browse files
committed
ui: support dark theme base colour resources
Support dark theme resource dictionaries.
1 parent 2cd5d69 commit fd66094

File tree

9 files changed

+25
-20
lines changed

9 files changed

+25
-20
lines changed

src/shared/Core/UI/Assets/Base.axaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
<ResourceDictionary.ThemeDictionaries>
4+
5+
<ResourceDictionary x:Key="Default">
6+
<Color x:Key="WindowBackgroundColor">#F6F6F6</Color>
7+
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WindowBackgroundColor}"/>
8+
<SolidColorBrush x:Key="DialogWindowCloseButtonBrush" Color="Black"/>
9+
</ResourceDictionary>
10+
11+
<ResourceDictionary x:Key="Dark">
12+
<Color x:Key="WindowBackgroundColor">#282828</Color>
13+
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WindowBackgroundColor}"/>
14+
<SolidColorBrush x:Key="DialogWindowCloseButtonBrush" Color="White"/>
15+
</ResourceDictionary>
16+
17+
</ResourceDictionary.ThemeDictionaries>
18+
</ResourceDictionary>

src/shared/Core/UI/Assets/DarkBase.axaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/shared/Core/UI/Assets/LightBase.axaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/shared/Core/UI/AvaloniaApp.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Application.Resources>
1010
<ResourceDictionary>
1111
<ResourceDictionary.MergedDictionaries>
12-
<ResourceInclude Source="avares://gcmcore/UI/Assets/LightBase.axaml"/>
12+
<ResourceInclude Source="avares://gcmcore/UI/Assets/Base.axaml"/>
1313
<ResourceInclude Source="avares://gcmcore/UI/Assets/Images.axaml"/>
1414
</ResourceDictionary.MergedDictionaries>
1515
</ResourceDictionary>

src/shared/Core/UI/Controls/AboutWindow.axaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
x:Class="GitCredentialManager.UI.Controls.AboutWindow"
77
Title="About Git Credential Manager"
88
CanResize="False" Width="300" SizeToContent="Height"
9-
Background="#F6F6F6">
10-
<Window.Styles>
11-
<StyleInclude Source="avares://gcmcore/UI/Assets/Controls.axaml"/>
12-
</Window.Styles>
9+
Background="{DynamicResource WindowBackgroundBrush}">
1310
<StackPanel Margin="20">
1411
<Image HorizontalAlignment="Center"
1512
Margin="0,10,0,10"
16-
Source="{StaticResource GcmLogo}" Width="128" Height="128" />
13+
Source="{DynamicResource GcmLogo}" Width="128" Height="128" />
1714
<TextBlock HorizontalAlignment="Center"
1815
Margin="0,5"
1916
FontWeight="Bold" FontSize="13"

src/shared/Core/UI/Controls/DialogWindow.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</Style>
4040
</Button.Styles>
4141
<Path Width="16" Height="16"
42-
Fill="Black"
42+
Fill="{DynamicResource DialogWindowCloseButtonBrush}"
4343
Data="F1M8.583,8L13,12.424 12.424,13 8,8.583 3.576,13 3,12.424 7.417,8 3,3.576 3.576,3 8,7.417 12.424,3 13,3.576z"/>
4444
</Button>
4545
<TextBlock DockPanel.Dock="Left" Margin="10,0,0,0"

src/shared/Core/UI/Views/CredentialsView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
IsVisible="{Binding ShowProductHeader}">
1818
<Image Margin="0,0,10,0"
1919
VerticalAlignment="Center"
20-
Source="{StaticResource GcmLogo}"
20+
Source="{DynamicResource GcmLogo}"
2121
Width="32" Height="32" />
2222
<TextBlock Text="Git Credential Manager"
2323
VerticalAlignment="Center"

src/shared/Core/UI/Views/DeviceCodeView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
IsVisible="{Binding ShowProductHeader}">
1717
<Image Margin="0,0,10,0"
1818
VerticalAlignment="Center"
19-
Source="{StaticResource GcmLogo}"
19+
Source="{DynamicResource GcmLogo}"
2020
Width="32" Height="32" />
2121
<TextBlock Text="Git Credential Manager"
2222
VerticalAlignment="Center"

src/shared/Core/UI/Views/OAuthView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
IsVisible="{Binding ShowProductHeader}">
1717
<Image Margin="0,0,10,0"
1818
VerticalAlignment="Center"
19-
Source="{StaticResource GcmLogo}"
19+
Source="{DynamicResource GcmLogo}"
2020
Width="32" Height="32" />
2121
<TextBlock Text="Git Credential Manager"
2222
VerticalAlignment="Center"

0 commit comments

Comments
 (0)