Browse Source

Add a resource for title bar background (#21440)

pull/21441/head
Julien Lebosquain 4 months ago
committed by GitHub
parent
commit
498c183f97
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Themes.Fluent/Accents/FluentControlResources.xaml
  2. 2
      src/Avalonia.Themes.Fluent/Controls/WindowDrawnDecorations.xaml
  3. 2
      src/Avalonia.Themes.Simple/Accents/Base.xaml
  4. 2
      src/Avalonia.Themes.Simple/Controls/WindowDrawnDecorations.xaml

2
src/Avalonia.Themes.Fluent/Accents/FluentControlResources.xaml

@ -825,6 +825,7 @@
<SolidColorBrush x:Key="CaptionButtonForeground" Color="Black" />
<SolidColorBrush x:Key="CaptionButtonBackground" Color="#ffe5e5e5" />
<SolidColorBrush x:Key="CaptionButtonBorderBrush" Color="#ffcacaca" />
<StaticResource x:Key="TitleBarBackgroundBrush" ResourceKey="SystemControlBackgroundAltHighBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<!-- Resources for Button.xaml -->
@ -1652,6 +1653,7 @@
<SolidColorBrush x:Key="CaptionButtonForeground" Color="White" />
<SolidColorBrush x:Key="CaptionButtonBackground" Color="#ffe5e5e5" />
<SolidColorBrush x:Key="CaptionButtonBorderBrush" Color="#ffcacaca" />
<StaticResource x:Key="TitleBarBackgroundBrush" ResourceKey="SystemControlBackgroundAltHighBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>

2
src/Avalonia.Themes.Fluent/Controls/WindowDrawnDecorations.xaml

@ -48,7 +48,7 @@
<!-- Titlebar: background, title text, and drag area live in underlay -->
<Panel x:Name="PART_TitleBar" VerticalAlignment="Top"
Height="{TemplateBinding TitleBarHeight}"
Background="{DynamicResource SystemControlTransparentBrush}"
Background="{DynamicResource TitleBarBackgroundBrush}"
IsVisible="{TemplateBinding HasTitleBar}"
WindowDecorationProperties.ElementRole="TitleBar" />

2
src/Avalonia.Themes.Simple/Accents/Base.xaml

@ -46,6 +46,7 @@
<SolidColorBrush x:Key="CaptionButtonForeground" Color="Black" />
<SolidColorBrush x:Key="CaptionButtonBackground" Color="#ffe5e5e5" />
<SolidColorBrush x:Key="CaptionButtonBorderBrush" Color="#ffcacaca" />
<StaticResource x:Key="TitleBarBackgroundBrush" ResourceKey="ThemeBackgroundBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
@ -91,6 +92,7 @@
<SolidColorBrush x:Key="CaptionButtonForeground" Color="White" />
<SolidColorBrush x:Key="CaptionButtonBackground" Color="#ffe5e5e5" />
<SolidColorBrush x:Key="CaptionButtonBorderBrush" Color="#ffcacaca" />
<StaticResource x:Key="TitleBarBackgroundBrush" ResourceKey="ThemeBackgroundBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<FontFamily x:Key="ContentControlThemeFontFamily">fonts:Inter#Inter, $Default</FontFamily>

2
src/Avalonia.Themes.Simple/Controls/WindowDrawnDecorations.xaml

@ -48,7 +48,7 @@
<!-- Titlebar: background, title text, and drag area live in underlay -->
<Panel x:Name="PART_TitleBar" VerticalAlignment="Top"
Height="{TemplateBinding TitleBarHeight}"
Background="Transparent"
Background="{DynamicResource TitleBarBackgroundBrush}"
IsVisible="{TemplateBinding HasTitleBar}"
WindowDecorationProperties.ElementRole="TitleBar" />
</Panel>

Loading…
Cancel
Save