Skip to content

Commit

Permalink
Fixes #788 by updating path rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Apr 9, 2020
1 parent 7ce10de commit 4530009
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 47 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for Fluent.Ribbon

## Next
- ### Bug fixes
- [#788](../../issues/788) - Maximize icon is incorrectly drawn on high-dpi displays

## 7.1.0
- ### Bug fixes
- [#745](../../issues/745) - SplitButton.IsEnabled based on Command.CanExecute?
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Stretch" />
Value="Center" />
<Setter Property="Padding"
Value="1" />
<Setter Property="Width"
Expand Down
80 changes: 34 additions & 46 deletions Fluent.Ribbon/Themes/Controls/WindowCommands.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@
Padding="0"
ToolTip="{Binding Minimize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}"
Uid="{Binding Minimize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}">
<Line HorizontalAlignment="Center"
<Path Width="10"
Height="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M0,0L10,0 10,1 10,1 1,1 0,1z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
UseLayoutRounding="True"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1.5"
X1="0"
X2="10"
Y1="0"
Y2="0" />
Stretch="Uniform" />
</Button>

<Button x:Name="PART_Max"
Expand All @@ -47,16 +46,15 @@
Visibility="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Converter={x:Static converters:StaticConverters.EqualsToVisibilityConverter}, ConverterParameter={x:Static WindowState.Normal}}"
ToolTip="{Binding Maximize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}"
Uid="{Binding Maximize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}">
<Canvas Width="12"
Height="12"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Path Data="M2,2 2,10 10,10 10,2 2,2Z M1,11 1,1 11,1 11,11 1,11Z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
Stretch="Uniform" />
</Canvas>
<Path Width="10"
Height="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M1,1L1,11 11,11 11,1z M0,0L12,0 12,12 0,12z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
Stretch="Uniform" />
</Button>

<Button x:Name="PART_Restore"
Expand All @@ -66,16 +64,15 @@
Visibility="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Converter={x:Static converters:StaticConverters.EqualsToVisibilityConverter}, ConverterParameter={x:Static WindowState.Maximized}}"
ToolTip="{Binding Restore, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}"
Uid="{Binding Restore, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}">
<Canvas Width="12"
Height="12"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Path Data="M10,9 9,9 9,3 3,3 3,2 10,2 10,9Z M8,11 1,11 1,4 8,4 8,11Z M2,1 2,3 0,3 0,12 9,12 9,10 11,10 11,1 2,1Z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
Stretch="Uniform" />
</Canvas>
<Path Width="10"
Height="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M1,4.56L1,14.56 11,14.56 11,4.56z M4,1L4,3.56 12,3.56 12,11 14,11 14,1z M3,0L15,0 15,12 12,12 12,15.56 0,15.56 0,3.56 3,3.56z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
Stretch="Uniform" />
</Button>

<Button x:Name="PART_Close"
Expand All @@ -84,24 +81,15 @@
Padding="0"
ToolTip="{Binding Close, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}"
Uid="{Binding Close, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:WindowCommands}}}">
<Grid>
<Line HorizontalAlignment="Center"
VerticalAlignment="Center"
SnapsToDevicePixels="True"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
X1="0"
X2="10"
Y1="0"
Y2="10" />
<Line HorizontalAlignment="Center"
VerticalAlignment="Center"
SnapsToDevicePixels="True"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
X1="0"
X2="10"
Y1="10"
Y2="0" />
</Grid>
<Path Width="10"
Height="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1M8.583,8L13,12.424 12.424,13 8,8.583 3.576,13 3,12.424 7.417,8 3,3.576 3.576,3 8,7.417 12.424,3 13,3.576z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
RenderOptions.EdgeMode="Aliased"
SnapsToDevicePixels="True"
Stretch="Uniform" />
</Button>
</StackPanel>
<ControlTemplate.Triggers>
Expand Down

0 comments on commit 4530009

Please sign in to comment.