Skip to content

Commit

Permalink
Fixes #116 by removing fixed height from Fluent:MenuItem contained in…
Browse files Browse the repository at this point in the history
… ApplicationMenu
  • Loading branch information
batzen committed Dec 17, 2015
1 parent 5c5323d commit 4a6e0c9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/BlueLarge.png">

<Fluent:MenuItem Header="Standard format"
Description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna."
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/BlueLarge.png" />

<Fluent:MenuItem Header="Export"
Expand Down
18 changes: 10 additions & 8 deletions Fluent.Ribbon/Themes/Office2010/Controls/ApplicationMenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
xmlns:Fluent="clr-namespace:Fluent"
xmlns:Converters="clr-namespace:Fluent.Converters"
mc:Ignorable="d">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Fluent;component\Themes\Office2010\Controls\RibbonScrollViewer.xaml" />
<ResourceDictionary Source="pack://application:,,,/Fluent;component\Themes\Office2010\Controls\MenuItem.xaml" />
</ResourceDictionary.MergedDictionaries>

<Converters:ApplicationMenuRightContentExtractorConverter x:Key="ApplicationMenuRightContentExtractorConvert" />

<!-- Second level-->
Expand All @@ -25,7 +20,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand Down Expand Up @@ -176,7 +172,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand Down Expand Up @@ -436,6 +433,7 @@
Margin="1"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -515,7 +513,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand Down Expand Up @@ -704,6 +703,7 @@
Style="{DynamicResource MenuScrollViewer}"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -1221,6 +1221,7 @@
Margin="1"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -1586,6 +1587,7 @@
Style="{DynamicResource MenuScrollViewer}"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down
24 changes: 16 additions & 8 deletions Fluent.Ribbon/Themes/Windows8/Controls/ApplicationMenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
xmlns:Fluent="clr-namespace:Fluent"
xmlns:Converters="clr-namespace:Fluent.Converters"
mc:Ignorable="d">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Fluent;component\Themes\Windows8\Controls\RibbonScrollViewer.xaml" />
<ResourceDictionary Source="pack://application:,,,/Fluent;component\Themes\Windows8\Controls\MenuItem.xaml" />
</ResourceDictionary.MergedDictionaries>

<Converters:ApplicationMenuRightContentExtractorConverter x:Key="ApplicationMenuRightContentExtractorConvert" />

<!-- Second level-->
Expand All @@ -25,7 +20,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand All @@ -44,6 +40,7 @@
Grid.ColumnSpan="3">
</Border>
<TextBlock x:Name="textBlock_Copy"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand All @@ -54,6 +51,7 @@
Visibility="Hidden"
HorizontalAlignment="Left" />
<TextBlock x:Name="textBlock"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand Down Expand Up @@ -169,7 +167,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand All @@ -188,6 +187,7 @@
Grid.ColumnSpan="3">
</Border>
<TextBlock x:Name="textBlock_Copy"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand All @@ -198,6 +198,7 @@
Visibility="Hidden"
HorizontalAlignment="Left" />
<TextBlock x:Name="textBlock"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand Down Expand Up @@ -421,6 +422,7 @@
Margin="1"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -500,7 +502,8 @@
</ResourceDictionary>
</ControlTemplate.Resources>
<Grid Width="Auto"
Height="53"
MinHeight="53"
Height="Auto"
Background="#00000000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="44" />
Expand Down Expand Up @@ -551,6 +554,7 @@
</Grid>

<TextBlock x:Name="textBlock_Copy"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand All @@ -561,6 +565,7 @@
Visibility="Hidden"
HorizontalAlignment="Left" />
<TextBlock x:Name="textBlock"
FontWeight="Bold"
Text="{TemplateBinding Header}"
Width="Auto"
Height="Auto"
Expand Down Expand Up @@ -677,6 +682,7 @@
Style="{DynamicResource MenuScrollViewer}"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -1183,6 +1189,7 @@
Margin="1"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down Expand Up @@ -1538,6 +1545,7 @@
Style="{DynamicResource MenuScrollViewer}"
SnapsToDevicePixels="True">
<StackPanel x:Name="PART_MenuPanel"
MaxWidth="{Binding ActualWidth, ElementName=PART_ScrollViewer}"
Orientation="Vertical"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
Expand Down

0 comments on commit 4a6e0c9

Please sign in to comment.