Skip to content

Commit 522c3ec

Browse files
authored
Fix: Fixed contrast issues with the preview pane icon (#12497)
1 parent eb38f9e commit 522c3ec

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

src/Files.App/Actions/Show/TogglePreviewPaneAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class TogglePreviewPaneAction : ObservableObject, IToggleAction
1919

2020
public string Description => "TogglePreviewPaneDescription".GetLocalizedResource();
2121

22-
public RichGlyph Glyph { get; } = new(opacityStyle: "ColorIconRightPane");
22+
public RichGlyph Glyph { get; } = new(opacityStyle: "ColorIconLeftPane");
2323
public HotKey HotKey { get; } = new(Keys.P, KeyModifiers.Ctrl);
2424

2525
public bool IsOn => viewModel.IsEnabled;

src/Files.App/ResourceDictionaries/PathIcons.xaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,48 @@
960960
</Setter>
961961
</Style>
962962

963+
<Style x:Key="ColorIconLeftPane" TargetType="local:OpacityIcon">
964+
<Setter Property="Template">
965+
<Setter.Value>
966+
<ControlTemplate>
967+
<Viewbox
968+
Width="12"
969+
Height="12"
970+
Stretch="Fill">
971+
<Grid Width="16" Height="16">
972+
<Path
973+
x:Name="Path1"
974+
Data="M7 14H12C13.1046 14 14 13.1046 14 12V5H7V14Z"
975+
Fill="{ThemeResource IconAltBrush}" />
976+
<Path
977+
x:Name="Path2"
978+
Data="M2 5H6V14H4C2.89543 14 2 13.1046 2 12V5Z"
979+
Fill="{ThemeResource AccentFillColorDefaultBrush}" />
980+
<Path
981+
x:Name="Path3"
982+
Data="M1 4C1 2.34315 2.34315 1 4 1H12C13.6569 1 15 2.34315 15 4V12C15 13.6569 13.6569 15 12 15H4C2.34315 15 1 13.6569 1 12V4ZM4 2C2.89543 2 2 2.89543 2 4H14C14 2.89543 13.1046 2 12 2H4ZM6 5H2V12C2 13.1046 2.89543 14 4 14H6V5ZM7 5V14H12C13.1046 14 14 13.1046 14 12V5H7Z"
983+
Fill="{ThemeResource IconBaseBrush}" />
984+
</Grid>
985+
986+
<VisualStateManager.VisualStateGroups>
987+
<VisualStateGroup>
988+
<VisualState x:Name="Normal" />
989+
<VisualState x:Name="Selected">
990+
<VisualState.Setters>
991+
<Setter Target="Path1.Fill" Value="{ThemeResource TextOnAccentFillColorPrimaryBrush}" />
992+
<Setter Target="Path2.Fill" Value="Transparent" />
993+
<Setter Target="Path3.Fill" Value="{ThemeResource TextOnAccentFillColorPrimaryBrush}" />
994+
</VisualState.Setters>
995+
</VisualState>
996+
<VisualState x:Name="Disabled" />
997+
</VisualStateGroup>
998+
</VisualStateManager.VisualStateGroups>
999+
</Viewbox>
1000+
</ControlTemplate>
1001+
</Setter.Value>
1002+
</Setter>
1003+
</Style>
1004+
9631005
<Style x:Key="ColorIconCopyPath" TargetType="local:OpacityIcon">
9641006
<Setter Property="Template">
9651007
<Setter.Value>

src/Files.App/UserControls/InnerNavigationToolbar.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@
886886
LabelPosition="Collapsed"
887887
ToolTipService.ToolTip="{x:Bind Commands.TogglePreviewPane.LabelWithHotKey, Mode=OneWay}"
888888
Visibility="{x:Bind ShowPreviewPaneButton, Mode=OneWay}">
889-
<local:OpacityIcon Style="{x:Bind Commands.TogglePreviewPane.OpacityStyle}" />
889+
<local:OpacityIcon IsSelected="{x:Bind Commands.TogglePreviewPane.IsOn, Mode=OneWay}" Style="{x:Bind Commands.TogglePreviewPane.OpacityStyle}" />
890890
</AppBarToggleButton>
891891

892892
<!-- 3 Dots Commands -->

0 commit comments

Comments
 (0)