Skip to content

Commit

Permalink
Fixes fluentribbon#202 by aligning styles for Button, DropDownButton …
Browse files Browse the repository at this point in the history
…and SplitButton
  • Loading branch information
batzen committed Nov 19, 2015
1 parent 23e574c commit 96ed26b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
3 changes: 1 addition & 2 deletions Fluent/Themes/Generic/Controls/TwoLineLabel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<StackPanel x:Name="stackPanel1"
Margin="0,-2,0,0"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
Expand Down Expand Up @@ -65,7 +64,7 @@
Value="Center" />
<Setter Property="Margin"
TargetName="stackPanel1"
Value="3,-2,0,0" />
Value="3,0,0,0" />
<Setter Property="VerticalAlignment"
TargetName="stackPanel1"
Value="Center" />
Expand Down
7 changes: 4 additions & 3 deletions Fluent/Themes/Office2013/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="2,-1,2,0" />
Margin="2,0,2,0" />
</StackPanel>
</Grid>
</Border>
Expand Down Expand Up @@ -61,7 +61,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 @@ -79,7 +79,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 @@ -141,6 +141,7 @@
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="RibbonButtonStyle"
TargetType="{x:Type Fluent:Button}">
<Setter Property="Template"
Expand Down
12 changes: 4 additions & 8 deletions Fluent/Themes/Office2013/Controls/DropDownButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Fluent;component\Themes\Office2010\Controls\MenuSeparator.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style x:Key="RibbonDropDownButtonStyle"
TargetType="{x:Type Fluent:DropDownButton}">
<Setter Property="Template"
Expand Down Expand Up @@ -37,7 +33,7 @@
<Setter Property="Height"
Value="22" />
<Setter Property="Width"
Value="31" />
Value="32" />
</Trigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -74,7 +70,7 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,-1,2,2"
Margin="2,0,2,2"
HasGlyph="{TemplateBinding HasTriangle}" />
</StackPanel>
</Grid>
Expand Down Expand Up @@ -221,7 +217,7 @@
Value="1,0,0,0" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="-2,-1,2,1" />
Value="-2,0,2,1" />
<Setter Property="Width"
TargetName="controlLabel"
Value="10" />
Expand All @@ -248,7 +244,7 @@
Value="False" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="2,-1,2,1" />
Value="2,0,2,1" />
<Setter Property="VerticalAlignment"
TargetName="PART_ButtonBorder"
Value="Stretch" />
Expand Down
30 changes: 13 additions & 17 deletions Fluent/Themes/Office2013/Controls/SplitButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Setter Property="Foreground"
Value="{DynamicResource DefaultFontBrush}" />
<Setter Property="SnapsToDevicePixels"
Value="True" />
Value="False" />
<Setter Property="HorizontalAlignment"
Value="Left" />
<Style.Triggers>
Expand All @@ -34,7 +34,7 @@
<Setter Property="Height"
Value="22" />
<Setter Property="Width"
Value="34" />
Value="32" />
</Trigger>
</Style.Triggers>
</Style>
Expand All @@ -49,7 +49,8 @@
<Border BorderThickness="1"
Name="PART_ButtonBorder"
BorderBrush="{DynamicResource TransparentBrush}"
Background="{DynamicResource TransparentBrush}">
Background="{DynamicResource TransparentBrush}"
VerticalAlignment="Stretch">
<StackPanel Orientation="Vertical"
Name="stackPanel">
<Fluent:ToggleButton x:Name="PART_Button"
Expand All @@ -68,7 +69,7 @@
IsChecked="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
IsDefinitive="{TemplateBinding IsDefinitive}"
CanAddToQuickAccessToolBar="{TemplateBinding CanAddButtonToQuickAccessToolBar}" />
<Border BorderThickness="0,1,0,0"
<Border BorderThickness="0,0,0,0"
Name="downBorder"
BorderBrush="{DynamicResource TransparentBrush}"
Background="{DynamicResource TransparentBrush}"
Expand All @@ -79,11 +80,8 @@
Style="{DynamicResource TwoLineLabelStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2,0,2,2"
Margin="2,1,2,2"
HasGlyph="{TemplateBinding HasTriangle}" />
<!--<ContentPresenter x:Name="iconImage" HorizontalAlignment="Center"
VerticalAlignment="Center" MinWidth="10" Margin="3,2" SnapsToDevicePixels="True"
IsHitTestVisible="false" Visibility="Hidden" />-->
</Grid>
</Border>
</StackPanel>
Expand Down Expand Up @@ -230,9 +228,9 @@
<Setter Property="Text"
TargetName="controlLabel"
Value="" />
<Setter Property="Margin"
<Setter Property="Padding"
TargetName="downBorder"
Value="0" />
Value="1,0,0,0" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand All @@ -251,9 +249,6 @@
<Setter Property="Text"
TargetName="controlLabel"
Value="" />
<Setter Property="Margin"
TargetName="downBorder"
Value="0" />
</Trigger>

<Trigger Property="IsButtonEnabled"
Expand Down Expand Up @@ -302,7 +297,7 @@
</MultiTrigger.Conditions>
<Setter Property="BorderBrush"
TargetName="PART_ButtonBorder"
Value="{DynamicResource ButtonHoverInnerBorderBrush}" />
Value="{DynamicResource ButtonHoverOuterBorderBrush}" />
<Setter Property="Background"
TargetName="downBorder"
Value="{DynamicResource ButtonHoverOuterBorderBrush}" />
Expand All @@ -327,7 +322,7 @@
<ControlTemplate x:Key="InnerButtonControlTemplate"
TargetType="{x:Type Fluent:ToggleButton}">
<Border x:Name="border"
BorderThickness="1"
BorderThickness="0"
Background="{DynamicResource TransparentBrush}"
BorderBrush="{DynamicResource TransparentBrush}"
Height="Auto"
Expand All @@ -346,6 +341,7 @@
HorizontalAlignment="Stretch"
SnapsToDevicePixels="True">
<ContentPresenter x:Name="iconImage"
Margin="0,1,0,0"
HorizontalAlignment="Center"
Height="32"
VerticalAlignment="Center"
Expand Down Expand Up @@ -428,7 +424,7 @@
Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="2,-1,2,1" />
Value="2,0,2,1" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
Expand All @@ -446,7 +442,7 @@
Value="False" />
<Setter Property="Margin"
TargetName="controlLabel"
Value="2,-1,-1,1" />
Value="2,0,-1,1" />
<Setter Property="VerticalAlignment"
TargetName="border"
Value="Stretch" />
Expand Down

0 comments on commit 96ed26b

Please sign in to comment.