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

feat: add style keys for some ribbon controls #1178

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
23 changes: 23 additions & 0 deletions Fluent.Ribbon/Themes/Common.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,27 @@

<Style TargetType="{x:Type Fluent:ResizeableContentControl}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.ResizeableContentControl}" />

<Style TargetType="{x:Type Fluent:ApplicationMenu}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.ApplicationMenu}" />
<Style TargetType="{x:Type Fluent:ColorGallery}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.ColorGallery}" />
<Style TargetType="{x:Type Fluent:ComboBox}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.ComboBox}" />
<Style TargetType="{x:Type Fluent:InRibbonGallery}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.InRibbonGallery}" />
<Style TargetType="{x:Type Fluent:RadioButton}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.RadioButton}" />
<Style TargetType="{x:Type Fluent:RibbonMenu}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.RibbonMenu}" />
<Style TargetType="{x:Type Fluent:TextBox}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.TextBox}" />
<Style TargetType="{x:Type ScrollBar}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.ScrollBar}" />
<Style TargetType="{x:Type Fluent:StatusBar}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.StatusBar}" />
<Style TargetType="{x:Type Fluent:StatusBarMenuItem}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.StatusBarMenuItem}" />
<Style TargetType="{x:Type Fluent:WindowCommands}"
BasedOn="{StaticResource Fluent.Ribbon.Styles.WindowCommands}" />
</ResourceDictionary>
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/ApplicationMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
</ControlTemplate.Triggers>
</ControlTemplate>

<Style TargetType="{x:Type Fluent:ApplicationMenu}">
<Style x:Key="Fluent.Ribbon.Styles.ApplicationMenu"
TargetType="{x:Type Fluent:ApplicationMenu}">
<Setter Property="Background" Value="{DynamicResource Fluent.Ribbon.Brushes.AccentBase}" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource Fluent.Ribbon.Styles.FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource Fluent.Ribbon.Brushes.IdealForeground}" />
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/ColorGallery.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
<Setter Property="Template" Value="{DynamicResource Fluent.Ribbon.Templates.ColorGallery.ListBox.Template.Row0}" />
</Style>

<Style TargetType="{x:Type Fluent:ColorGallery}">
<Style x:Key="Fluent.Ribbon.Styles.ColorGallery"
TargetType="{x:Type Fluent:ColorGallery}">
<Setter Property="ChipHeight" Value="13" />
<Setter Property="ChipWidth" Value="13" />
<Setter Property="Template">
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@
TextWrapping="Wrap" />
</DataTemplate>

<Style TargetType="{x:Type Fluent:ComboBox}">
<Style x:Key="Fluent.Ribbon.Styles.ComboBox"
TargetType="{x:Type Fluent:ComboBox}">
<Setter Property="Fluent:RibbonProperties.IconSize" Value="Small" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource Fluent.Ribbon.Styles.FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource Fluent.Ribbon.Brushes.LabelText}" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/InRibbonGallery.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@

<DataTemplate x:Key="Fluent.Ribbon.DataTemplates.InRibbonGallery.Header" />

<Style x:Key="{x:Type Fluent:InRibbonGallery}"
<Style x:Key="Fluent.Ribbon.Styles.InRibbonGallery"
TargetType="{x:Type Fluent:InRibbonGallery}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Template" Value="{DynamicResource Fluent.Ribbon.Templates.InRibbonGallery}" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/RadioButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
</ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="{x:Type Fluent:RadioButton}"
<Style x:Key="Fluent.Ribbon.Styles.RadioButton"
TargetType="{x:Type Fluent:RadioButton}">
<Setter Property="Background" Value="{DynamicResource Fluent.Ribbon.Brushes.CheckBox.Background}" />
<Setter Property="BorderBrush" Value="{DynamicResource Fluent.Ribbon.Brushes.CheckBox.Border}" />
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/RibbonMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent">
<Style TargetType="{x:Type Fluent:RibbonMenu}">
<Style x:Key="Fluent.Ribbon.Styles.RibbonMenu"
TargetType="{x:Type Fluent:RibbonMenu}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/RibbonTextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@
TextWrapping="Wrap" />
</DataTemplate>

<Style TargetType="{x:Type Fluent:TextBox}"
<Style x:Key="Fluent.Ribbon.Styles.TextBox"
TargetType="{x:Type Fluent:TextBox}"
BasedOn="{StaticResource {x:Type TextBoxBase}}">
<Setter Property="CaretBrush" Value="{DynamicResource Fluent.Ribbon.Brushes.TextBox.Caret}" />
<Setter Property="Fluent:InputControlProperties.InputMinWidth" Value="30" />
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/ScrollBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@
</ControlTemplate.Triggers>
</ControlTemplate>

<Style TargetType="ScrollBar">
<Style x:Key="Fluent.Ribbon.Styles.ScrollBar"
TargetType="ScrollBar">
<Setter Property="Foreground" Value="{DynamicResource Fluent.Ribbon.Brushes.Black}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Style.Triggers>
Expand Down
5 changes: 3 additions & 2 deletions Fluent.Ribbon/Themes/Controls/StatusBar.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent">
<Style x:Key="{x:Type Fluent:StatusBar}"
<Style x:Key="Fluent.Ribbon.Styles.StatusBar"
TargetType="{x:Type Fluent:StatusBar}">
<Setter Property="Background" Value="{DynamicResource Fluent.Ribbon.Brushes.AccentBase}" />
<Setter Property="Height" Value="Auto" />
Expand Down Expand Up @@ -72,7 +72,8 @@
</Style>

<!-- Menu Item Style -->
<Style TargetType="{x:Type Fluent:StatusBarMenuItem}">
<Style x:Key="Fluent.Ribbon.Styles.StatusBarMenuItem"
TargetType="{x:Type Fluent:StatusBarMenuItem}">
<Setter Property="Foreground" Value="{DynamicResource Fluent.Ribbon.Brushes.LabelText}" />
<Setter Property="IsCheckable" Value="True" />
<Setter Property="IsChecked" Value="{Binding StatusBarItem.IsChecked, RelativeSource={RelativeSource Self}, Mode=TwoWay}" />
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Themes/Controls/WindowCommands.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
</ControlTemplate.Triggers>
</ControlTemplate>

<Style TargetType="{x:Type Fluent:WindowCommands}">
<Style x:Key="Fluent.Ribbon.Styles.WindowCommands"
TargetType="{x:Type Fluent:WindowCommands}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Foreground" Value="{DynamicResource Fluent.Ribbon.Brushes.LabelText}" />
<Setter Property="Template" Value="{DynamicResource Fluent.Ribbon.Templates.WindowCommands}" />
Expand Down