Skip to content

Adds style for StatusBarItem in fluent #10501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,11 @@
<!-- StatusBar -->
<!-- TO DO -->

<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource ControlFillColorDisabled}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource TextFillColorDisabled}" />

<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SubtleFillColorTransparent}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource TextFillColorPrimary}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@
<!-- StatusBar -->
<!-- TO DO -->

<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource SystemColorGrayTextColor}" />

<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource SystemColorWindowTextColor}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@
<!-- StatusBar -->
<!-- TO DO -->

<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource ControlFillColorDisabled}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource TextFillColorDisabled}" />

<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SubtleFillColorTransparent}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource TextFillColorPrimary}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">

<Thickness x:Key="StatusBarItemPadding">4</Thickness>

<Style x:Key="DefaultStatusBarItemStyle" TargetType="{x:Type StatusBarItem}">
<Setter Property="Padding" Value="{DynamicResource StatusBarItemPadding}"/>
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackground}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type StatusBarItem}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource StatusBarItemForegroundDisabled}"/>
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackgroundDisabled}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultStatusBarItemStyle}" TargetType="{x:Type StatusBarItem}" />
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,10 @@
<SolidColorBrush x:Key="SnackBarBorderBrush" Color="{StaticResource SurfaceStrokeColorFlyout}" />
<!-- StatusBar -->
<!-- TO DO -->
<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource ControlFillColorDisabled}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource TextFillColorDisabled}" />
<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SubtleFillColorTransparent}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource TextFillColorPrimary}" />
Expand Down Expand Up @@ -3991,6 +3995,29 @@
<Setter Property="Padding" Value="12" />
<Setter Property="Margin" Value="0" />
</Style>
<Thickness x:Key="StatusBarItemPadding">4</Thickness>
<Style x:Key="DefaultStatusBarItemStyle" TargetType="{x:Type StatusBarItem}">
<Setter Property="Padding" Value="{DynamicResource StatusBarItemPadding}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackground}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type StatusBarItem}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource StatusBarItemForegroundDisabled}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackgroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultStatusBarItemStyle}" TargetType="{x:Type StatusBarItem}" />
<!-- Styles when TabItems are on the Top -->
<ControlTemplate x:Key="DefaultTopTabControlStyle" TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@
<SolidColorBrush x:Key="SnackBarBorderBrush" Color="{StaticResource SystemColorWindowTextColor}" />
<!-- StatusBar -->
<!-- TO DO -->
<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource SystemColorGrayTextColor}" />
<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource SystemColorWindowTextColor}" />
Expand Down Expand Up @@ -3972,6 +3976,29 @@
<Setter Property="Padding" Value="12" />
<Setter Property="Margin" Value="0" />
</Style>
<Thickness x:Key="StatusBarItemPadding">4</Thickness>
<Style x:Key="DefaultStatusBarItemStyle" TargetType="{x:Type StatusBarItem}">
<Setter Property="Padding" Value="{DynamicResource StatusBarItemPadding}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackground}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type StatusBarItem}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource StatusBarItemForegroundDisabled}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackgroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultStatusBarItemStyle}" TargetType="{x:Type StatusBarItem}" />
<!-- Styles when TabItems are on the Top -->
<ControlTemplate x:Key="DefaultTopTabControlStyle" TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@
<SolidColorBrush x:Key="SnackBarBorderBrush" Color="{StaticResource SurfaceStrokeColorFlyout}" />
<!-- StatusBar -->
<!-- TO DO -->
<!-- StatusBarItem -->
<SolidColorBrush x:Key="StatusBarItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="StatusBarItemBackgroundDisabled" Color="{StaticResource ControlFillColorDisabled}" />
<SolidColorBrush x:Key="StatusBarItemForegroundDisabled" Color="{StaticResource TextFillColorDisabled}" />
<!-- TabControl / TabView -->
<SolidColorBrush x:Key="TabViewBackground" Color="{StaticResource SubtleFillColorTransparent}" />
<SolidColorBrush x:Key="TabViewForeground" Color="{StaticResource TextFillColorPrimary}" />
Expand Down Expand Up @@ -3988,6 +3992,29 @@
<Setter Property="Padding" Value="12" />
<Setter Property="Margin" Value="0" />
</Style>
<Thickness x:Key="StatusBarItemPadding">4</Thickness>
<Style x:Key="DefaultStatusBarItemStyle" TargetType="{x:Type StatusBarItem}">
<Setter Property="Padding" Value="{DynamicResource StatusBarItemPadding}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackground}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type StatusBarItem}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource StatusBarItemForegroundDisabled}" />
<Setter Property="Background" Value="{DynamicResource StatusBarItemBackgroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultStatusBarItemStyle}" TargetType="{x:Type StatusBarItem}" />
<!-- Styles when TabItems are on the Top -->
<ControlTemplate x:Key="DefaultTopTabControlStyle" TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Separator.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Slider.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/StatusBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/StatusBarItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/TabControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/TextBox.xaml" />
Expand Down