Skip to content
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

Adds style for GroupBox in fluent #10504

Merged
merged 10 commits into from
Feb 26, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
<SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemFillColorSolidAttentionBackground}" />
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemFillColorSolidNeutralBackground}" />


<!-- Elevation border brushes -->

<LinearGradientBrush x:Key="ControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,3">
Expand Down Expand Up @@ -482,6 +483,11 @@
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource ControlAltFillColorDisabled}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource ControlStrongFillColorDefault}" />

<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />

<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemAccentColorLight3}" />
<SolidColorBrush x:Key="HyperlinkForegroundPointerOver" Color="{StaticResource SystemAccentColorLight3}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource SystemColorButtonTextColor}" />

<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="{StaticResource SystemColorButtonFaceColor}" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="{StaticResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource SystemColorButtonTextColor}" />

<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemColorHotlightColor}" />
<SolidColorBrush x:Key="HyperlinkForegroundPointerOver" Color="{StaticResource SystemColorHotlightColor}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
<SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemFillColorSolidAttentionBackground}" />
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemFillColorSolidNeutralBackground}" />


<!-- Elevation border brushes -->

<LinearGradientBrush x:Key="ControlElevationBorderBrush" MappingMode="RelativeToBoundingBox" StartPoint="0,1" EndPoint="0,0">
Expand Down Expand Up @@ -478,6 +479,11 @@
<SolidColorBrush x:Key="GridsplitterBackgroundPressed" Color="{StaticResource ControlAltFillColorQuarternary}" />
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource ControlAltFillColorDisabled}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource ControlStrongFillColorDefault}" />

<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />

<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemAccentColorDark2}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<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="GroupBoxPadding">0,0,0,16</Thickness>
<system:Double x:Key="GroupBoxHeaderFontSize">20</system:Double>
<Thickness x:Key="GroupBoxHeaderMargin">0,4,0,12</Thickness>
<Thickness x:Key="GroupBoxBorderThickness">0</Thickness>

<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" />
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter
Grid.Row="0"
TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}"
Margin="{DynamicResource GroupBoxHeaderMargin}"
ContentSource="Header"
TextElement.Foreground="{DynamicResource GroupBoxHeaderForeground}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ContentPresenter
Grid.Row="1"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style BasedOn="{StaticResource DefaultGroupBoxStyle}" TargetType="{x:Type GroupBox}" />

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@
<SolidColorBrush x:Key="GridsplitterBackgroundPressed" Color="{StaticResource ControlAltFillColorQuarternary}" />
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource ControlAltFillColorDisabled}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource ControlStrongFillColorDefault}" />
<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemAccentColorLight3}" />
<SolidColorBrush x:Key="HyperlinkForegroundPointerOver" Color="{StaticResource SystemAccentColorLight3}" />
Expand Down Expand Up @@ -2710,6 +2714,34 @@
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGridSplitterStyle}" TargetType="{x:Type GridSplitter}" />
<Thickness x:Key="GroupBoxPadding">0,0,0,16</Thickness>
<system:Double x:Key="GroupBoxHeaderFontSize">20</system:Double>
<Thickness x:Key="GroupBoxHeaderMargin">0,4,0,12</Thickness>
<Thickness x:Key="GroupBoxBorderThickness">0</Thickness>
<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" />
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}" Margin="{DynamicResource GroupBoxHeaderMargin}" ContentSource="Header" TextElement.Foreground="{DynamicResource GroupBoxHeaderForeground}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ContentPresenter Grid.Row="1" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGroupBoxStyle}" TargetType="{x:Type GroupBox}" />
<Style x:Key="{x:Type GroupItem}" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
<SolidColorBrush x:Key="GridsplitterBackgroundPressed" Color="{StaticResource SystemColorHighlightColor}" />
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource SystemColorButtonTextColor}" />
<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="{StaticResource SystemColorButtonFaceColor}" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="{StaticResource SystemColorButtonTextColor}" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource SystemColorButtonTextColor}" />
<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemColorHotlightColor}" />
<SolidColorBrush x:Key="HyperlinkForegroundPointerOver" Color="{StaticResource SystemColorHotlightColor}" />
Expand Down Expand Up @@ -2691,6 +2695,34 @@
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGridSplitterStyle}" TargetType="{x:Type GridSplitter}" />
<Thickness x:Key="GroupBoxPadding">0,0,0,16</Thickness>
<system:Double x:Key="GroupBoxHeaderFontSize">20</system:Double>
<Thickness x:Key="GroupBoxHeaderMargin">0,4,0,12</Thickness>
<Thickness x:Key="GroupBoxBorderThickness">0</Thickness>
<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" />
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}" Margin="{DynamicResource GroupBoxHeaderMargin}" ContentSource="Header" TextElement.Foreground="{DynamicResource GroupBoxHeaderForeground}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ContentPresenter Grid.Row="1" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGroupBoxStyle}" TargetType="{x:Type GroupBox}" />
<Style x:Key="{x:Type GroupItem}" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,10 @@
<SolidColorBrush x:Key="GridsplitterBackgroundPressed" Color="{StaticResource ControlAltFillColorQuarternary}" />
<SolidColorBrush x:Key="GridsplitterBackgroundDisabled" Color="{StaticResource ControlAltFillColorDisabled}" />
<SolidColorBrush x:Key="GridsplitterForeground" Color="{StaticResource ControlStrongFillColorDefault}" />
<!-- GroupBox -->
<SolidColorBrush x:Key="GroupBoxBackground" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="GroupBoxHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
<!-- Hyperlink -->
<SolidColorBrush x:Key="HyperlinkForeground" Color="{StaticResource SystemAccentColorDark2}" />
<SolidColorBrush x:Key="HyperlinkForegroundPointerOver" Color="{StaticResource SystemAccentColorDark2}" />
Expand Down Expand Up @@ -2707,6 +2711,34 @@
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGridSplitterStyle}" TargetType="{x:Type GridSplitter}" />
<Thickness x:Key="GroupBoxPadding">0,0,0,16</Thickness>
<system:Double x:Key="GroupBoxHeaderFontSize">20</system:Double>
<Thickness x:Key="GroupBoxHeaderMargin">0,4,0,12</Thickness>
<Thickness x:Key="GroupBoxBorderThickness">0</Thickness>
<Style x:Key="DefaultGroupBoxStyle" TargetType="{x:Type GroupBox}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" />
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" TextElement.FontSize="{DynamicResource GroupBoxHeaderFontSize}" Margin="{DynamicResource GroupBoxHeaderMargin}" ContentSource="Header" TextElement.Foreground="{DynamicResource GroupBoxHeaderForeground}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ContentPresenter Grid.Row="1" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultGroupBoxStyle}" TargetType="{x:Type GroupBox}" />
<Style x:Key="{x:Type GroupItem}" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Expander.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Frame.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/GridSplitter.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/GroupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/GroupItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/HeaderedContentControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Hyperlink.xaml" />
Expand Down