Skip to content

Commit

Permalink
Fixes #509 by improving style for MenuItem
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Feb 3, 2018
1 parent bad4cc4 commit f4a48ce
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 41 deletions.
5 changes: 4 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Changelog for Fluent.Ribbon

## 6.0.1 (preview)
## 6.1.0 (preview)

- ### Bug fixes
- [#510](../../issues/510) - Submenus in DropDownButton are not opened each time
- [#511](../../issues/511) - Binding on RibbonWindow.Icon not working
- [#512](../../issues/512) - Ideal text color should match the colors in the ribbon
- [#513](../../issues/513) - Hovering causes flickering of ribbon backstage menu items

- ### Enhancements
- [#509](../../issues/509) - Checked mark + Icon image at Menuitem

## 6.0.0

- ### Breaking changes
Expand Down
6 changes: 4 additions & 2 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1726,12 +1726,14 @@
IsCheckable="True"
IsChecked="True"
GroupName="{Binding Converter={StaticResource UniqueGroupNameConverter}, ConverterParameter=Group2}">
<Fluent:MenuItem Header="First"
IsChecked="True"
<Fluent:MenuItem Header="First (with icon)"
IsCheckable="True"
IsChecked="True"
Icon="Images/Pink.png"
GroupName="{Binding Converter={StaticResource UniqueGroupNameConverter}, ConverterParameter=MenuItemGroup1}" />
<Fluent:MenuItem Header="Second"
IsCheckable="True"
IsChecked="True"
GroupName="{Binding Converter={StaticResource UniqueGroupNameConverter}, ConverterParameter=MenuItemGroup1}" />
<Fluent:MenuItem Header="Third"
IsCheckable="True"
Expand Down
115 changes: 80 additions & 35 deletions Fluent.Ribbon/Themes/Controls/MenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,17 @@
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
BorderThickness="1">
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
</Border>
<TextBlock x:Name="gestureTextBlock"
Text="{TemplateBinding InputGestureText}"
Width="Auto"
Expand All @@ -213,6 +216,15 @@
TargetName="gestureTextBlock"
Value="Collapsed" />
</Trigger>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Background"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.Background}" />
<Setter Property="BorderBrush"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.BorderBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Icon"
Expand Down Expand Up @@ -308,15 +320,17 @@
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True"
RecognizesAccessKey="True" />
<Border x:Name="iconImageBorder"
BorderThickness="1">
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
</Border>
<Path x:Name="path"
Stretch="Fill"
Stroke="{x:Null}"
Expand Down Expand Up @@ -447,6 +461,15 @@
TargetName="resizeBorder"
Value="Visible" />
</Trigger>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Background"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.Background}" />
<Setter Property="BorderBrush"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.BorderBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Icon"
Expand Down Expand Up @@ -563,15 +586,17 @@
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}, RelativeSource={RelativeSource TemplatedParent}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True"
RecognizesAccessKey="True" />
<Border x:Name="iconImageBorder"
BorderThickness="1">
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
</Border>
<Path x:Name="path"
Stretch="Fill"
Stroke="{x:Null}"
Expand Down Expand Up @@ -703,6 +728,15 @@
TargetName="resizeBorder"
Value="Visible" />
</Trigger>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Background"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.Background}" />
<Setter Property="BorderBrush"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.BorderBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Icon"
Expand Down Expand Up @@ -819,15 +853,17 @@
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Grid.RowSpan="2"
HorizontalAlignment="Center"
Height="32"
VerticalAlignment="Top"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="32"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
BorderThickness="1">
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="16"
VerticalAlignment="Center"
Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="16"
Margin="3,2,2,2"
SnapsToDevicePixels="True" />
</Border>
<TextBlock x:Name="gestureTextBlock"
Text="{TemplateBinding InputGestureText}"
Width="Auto"
Expand All @@ -849,6 +885,15 @@
TargetName="gestureTextBlock"
Value="Collapsed" />
</Trigger>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Background"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.Background}" />
<Setter Property="BorderBrush"
TargetName="iconImageBorder"
Value="{DynamicResource Fluent.Ribbon.Brushes.ToggleButton.Checked.BorderBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Icon"
Expand Down
4 changes: 2 additions & 2 deletions Shared/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("6.0.1")]
[assembly: AssemblyFileVersion("6.0.1")]
[assembly: AssemblyVersion("6.1.0")]
[assembly: AssemblyFileVersion("6.1.0")]
[assembly: AssemblyInformationalVersion("SRC")]

[assembly: ComVisible(false)]
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
only:
- develop

version: 6.0.1-dev{build}
version: 6.1.0-dev{build}
configuration: Release

init:
Expand Down

0 comments on commit f4a48ce

Please sign in to comment.