Skip to content

Commit

Permalink
Fixes #237 by changing margins and heights in Button, ToggleButton, D…
Browse files Browse the repository at this point in the history
…ropDownButton and SplitButton
  • Loading branch information
batzen committed Jan 5, 2016
1 parent ce51d7d commit 8985884
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 68 deletions.
4 changes: 2 additions & 2 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@
</Fluent:RibbonGroupBox>

<Fluent:RibbonGroupBox Header="Split buttons">
<Fluent:SplitButton Header="Too many items"
<Fluent:SplitButton Header="Too many items gggg"
ResizeMode="Both"
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Box.png"
LargeIcon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Box.png">
Expand Down Expand Up @@ -990,7 +990,7 @@
<MenuItem Header="25" />
</Fluent:SplitButton>

<Fluent:DropDownButton Header="Dropdown (auto close on click)"
<Fluent:DropDownButton Header="Dropdown (auto close on click) g"
ResizeMode="Both"
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Icons/App.ico"
LargeIcon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Icons/App.ico"
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Office2010/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="2,-1,2,2" />
Margin="2,-3,2,2" />
</StackPanel>
</Grid>
</Border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,-2,2,2"
Margin="2,-4,2,2"
HasGlyph="{TemplateBinding HasTriangle}" />
</StackPanel>
</Grid>
Expand Down
43 changes: 20 additions & 23 deletions Fluent.Ribbon/Themes/Office2010/Controls/SplitButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,33 @@
</Rectangle>
<Border x:Name="downRect"
VerticalAlignment="Bottom"
Height="28"
Height="29"
Background="{DynamicResource TransparentBrush}"
BorderThickness="0,1,0,0"
Margin="-1,0" />
<Border x:Name="downRect_Copy"
VerticalAlignment="Bottom"
Height="27"
Height="28"
Background="{DynamicResource TransparentBrush}"
BorderThickness="1"
Margin="-1,1,-1,0"
IsHitTestVisible="False" />
<Fluent:ToggleButton x:Name="PART_Button"
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}"
CommandTarget="{TemplateBinding CommandTarget}"
Margin="-2,-2,-2,28"
Height="Auto"
Width="Auto"
Style="{DynamicResource InnerButtonStyle}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Icon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
IsEnabled="{TemplateBinding IsButtonEnabled}"
Header="{TemplateBinding Header}"
ToolTip="{TemplateBinding ToolTip}"
IsChecked="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
IsDefinitive="{TemplateBinding IsDefinitive}"
CanAddToQuickAccessToolBar="{TemplateBinding CanAddButtonToQuickAccessToolBar}" />
<StackPanel x:Name="stackPanel"
Width="Auto"
Orientation="Vertical"
Expand All @@ -109,25 +125,9 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,0,2,2"
Margin="2,-4,2,2"
HasGlyph="{TemplateBinding HasTriangle}" />
</StackPanel>
<Fluent:ToggleButton x:Name="PART_Button"
Command="{TemplateBinding Command}"
CommandParameter="{TemplateBinding CommandParameter}"
CommandTarget="{TemplateBinding CommandTarget}"
Margin="-2,-2,-2,26"
Height="Auto"
Width="Auto"
Style="{DynamicResource InnerButtonStyle}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Icon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
IsEnabled="{TemplateBinding IsButtonEnabled}"
Header="{TemplateBinding Header}"
ToolTip="{TemplateBinding ToolTip}"
IsChecked="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
IsDefinitive="{TemplateBinding IsDefinitive}"
CanAddToQuickAccessToolBar="{TemplateBinding CanAddButtonToQuickAccessToolBar}" />
</StackPanel>
</Grid>
</Border>
</Border>
Expand Down Expand Up @@ -382,9 +382,6 @@
<Setter Property="Height"
TargetName="downRect"
Value="Auto" />
<Setter Property="Style"
TargetName="PART_Button"
Value="{DynamicResource InnerButtonStyle}" />
<Setter Property="Margin"
TargetName="downRect"
Value="-1,-2,-1,-1" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Office2010/Controls/ToggleButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="2,-2,2,2" />
Margin="2,-4,2,2" />
</StackPanel>
</Grid>
</Border>
Expand Down
4 changes: 2 additions & 2 deletions Fluent.Ribbon/Themes/Office2013/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<Setter Property="Template"
Value="{DynamicResource RibbonButtonControlTemplate}" />
<Setter Property="Height"
Value="66" />
Value="68" />
<Setter Property="Width"
Value="Auto" />
<Setter Property="Foreground"
Expand All @@ -168,7 +168,7 @@
<Trigger Property="Size"
Value="Large">
<Setter Property="Height"
Value="66" />
Value="68" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Office2013/Controls/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Setter Property="Template"
Value="{DynamicResource RibbonComboButtonControlTemplate}" />
<Setter Property="Height"
Value="66" />
Value="68" />
<Setter Property="Width"
Value="Auto" />
<Setter Property="Foreground"
Expand Down
4 changes: 2 additions & 2 deletions Fluent.Ribbon/Themes/Office2013/Controls/DropDownButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Setter Property="Template"
Value="{DynamicResource RibbonDropDownButtonControlTemplate}" />
<Setter Property="Height"
Value="66" />
Value="68" />
<Setter Property="Width"
Value="Auto" />
<Setter Property="Foreground"
Expand All @@ -21,7 +21,7 @@
<Trigger Property="Size"
Value="Large">
<Setter Property="Height"
Value="66" />
Value="68" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand Down
4 changes: 2 additions & 2 deletions Fluent.Ribbon/Themes/Office2013/Controls/SplitButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Setter Property="Template"
Value="{DynamicResource RibbonSplitButtonControlTemplate}" />
<Setter Property="Height"
Value="66" />
Value="68" />
<Setter Property="Width"
Value="Auto" />
<Setter Property="Foreground"
Expand All @@ -22,7 +22,7 @@
<Trigger Property="Size"
Value="Large">
<Setter Property="Height"
Value="66" />
Value="68" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand Down
4 changes: 2 additions & 2 deletions Fluent.Ribbon/Themes/Office2013/Controls/ToggleButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Setter Property="Template"
Value="{DynamicResource RibbonToggleButtonControlTemplate}" />
<Setter Property="Height"
Value="66" />
Value="68" />
<Setter Property="Width"
Value="Auto" />
<Setter Property="Foreground"
Expand All @@ -22,7 +22,7 @@
<Trigger Property="Size"
Value="Large">
<Setter Property="Height"
Value="66" />
Value="68" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand Down
34 changes: 17 additions & 17 deletions Fluent.Ribbon/Themes/Windows8/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
TargetType="{x:Type Fluent:Button}">
<Border x:Name="border"
CornerRadius="{TemplateBinding CornerRadius}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Height="Auto"
Expand All @@ -21,21 +21,21 @@
Orientation="Vertical"
d:LayoutOverrides="Width, Height">
<ContentPresenter x:Name="iconImage"
HorizontalAlignment="Center"
Height="32"
VerticalAlignment="Center"
Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="32"
Margin="3,2"
SnapsToDevicePixels="True" />
HorizontalAlignment="Center"
Height="32"
VerticalAlignment="Center"
Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}"
Width="32"
Margin="3,2,3,1"
SnapsToDevicePixels="True" />
<Fluent:TwoLineLabel x:Name="controlLabel"
Text="{TemplateBinding Header}"
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="2,0,2,0" />
Text="{TemplateBinding Header}"
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="2,-1,2,0" />
</StackPanel>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Size"
Expand Down Expand Up @@ -63,7 +63,7 @@
Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static Converters:StaticConverters.ObjectToImageConverter}}" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="2,-1,2,1" />
Value="2,0,2,0" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand All @@ -81,7 +81,7 @@
Value="False" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="2,-1,2,1" />
Value="2,0,2,0" />
<Setter Property="VerticalAlignment"
TargetName="border"
Value="Stretch" />
Expand Down Expand Up @@ -143,7 +143,7 @@
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="RibbonButtonStyle"
TargetType="{x:Type Fluent:Button}">
<Setter Property="Template"
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Windows8/Controls/DropDownButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,0,2,0"
Margin="2,-2,2,0"
HasGlyph="{TemplateBinding HasTriangle}" />
</StackPanel>
</Grid>
Expand Down
19 changes: 7 additions & 12 deletions Fluent.Ribbon/Themes/Windows8/Controls/SplitButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,13 @@
BorderBrush="{DynamicResource TransparentBrush}"
Background="{DynamicResource TransparentBrush}"
Margin="0,0,0,0">
<Grid>
<Fluent:TwoLineLabel x:Name="controlLabel"
Text="{TemplateBinding Header}"
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,-1,2,0"
HasGlyph="{TemplateBinding HasTriangle}" />
<!--<ContentPresenter x:Name="iconImage" HorizontalAlignment="Center"
VerticalAlignment="Center" MinWidth="10" Margin="3,2" SnapsToDevicePixels="True"
IsHitTestVisible="false" Visibility="Hidden" />-->
</Grid>
<Fluent:TwoLineLabel x:Name="controlLabel"
Text="{TemplateBinding Header}"
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,-3,2,0"
HasGlyph="{TemplateBinding HasTriangle}" />
</Border>
</StackPanel>
</Border>
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Windows8/Controls/ToggleButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="2,0,2,0" />
Margin="2,-2,2,0" />
</StackPanel>
</Grid>
</Border>
Expand Down

0 comments on commit 8985884

Please sign in to comment.