Skip to content

Fix: Fixed high contrast support in menu flyouts #14664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
<CornerRadius x:Key="GridViewThumbnailCornerRadius">2</CornerRadius>
<CornerRadius x:Key="DetailsLayoutThumbnailCornerRadius">2</CornerRadius>

<!-- Workaround for https://github.com/files-community/Files/issues/13078 -->
<Style TargetType="FlyoutPresenter">
<Setter Target="HighContrastAdjustment" Value="None" />
</Style>

<Style TargetType="MenuFlyoutPresenter">
<Setter Target="HighContrastAdjustment" Value="None" />
</Style>

<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />

Expand Down
20 changes: 0 additions & 20 deletions src/Files.App/Dialogs/PropertiesDialog.xaml

This file was deleted.

15 changes: 0 additions & 15 deletions src/Files.App/Dialogs/PropertiesDialog.xaml.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Files.App/Dialogs/ReleaseNotesDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<Border
Grid.Row="2"
Padding="12"
Background="{ThemeResource SolidBackgroundFillColorBase}"
Background="{ThemeResource SolidBackgroundFillColorBaseBrush}"
BackgroundSizing="OuterBorderEdge"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0">
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Dialogs/SettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Grid
x:Name="ContainerGrid"
MaxHeight="790"
Background="{ThemeResource SolidBackgroundFillColorBase}">
Background="{ThemeResource SolidBackgroundFillColorBaseBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="44" />
<RowDefinition Height="*" />
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/UserControls/DataGridHeader.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ControlAltFillColorTertiary}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ControlAltFillColorTertiaryBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBorderBrushPointerOver}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400"
HighContrastAdjustment="None"
mc:Ignorable="d">

<MenuFlyoutItem.Style>
Expand Down
2 changes: 2 additions & 0 deletions src/Files.App/UserControls/PathBreadcrumb.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="MaxHeight" Value="400" />
<!-- Workaround for https://github.com/files-community/Files/issues/13078 -->
<Setter Target="HighContrastAdjustment" Value="None" />
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
</MenuFlyout>
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/UserControls/SideBar/SideBarControls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
VerticalAlignment="Center"
AnimatedIcon.State="NormalOff"
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
RenderTransformOrigin="0.5, 0.5"
Visibility="Collapsed">
<animatedvisuals:AnimatedChevronUpDownSmallVisualSource />
Expand Down
6 changes: 3 additions & 3 deletions src/Files.App/Views/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
Height="12"
AnimatedIcon.State="NormalOff"
AutomationProperties.AccessibilityView="Raw"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
RenderTransformOrigin="0.5, 0.5">
<animatedvisuals:AnimatedChevronUpDownSmallVisualSource />
<AnimatedIcon.FallbackIconSource>
Expand Down Expand Up @@ -271,7 +271,7 @@
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ExpanderChevronBackground}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorSecondary}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorSecondaryBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
Expand Down Expand Up @@ -341,7 +341,7 @@
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ExpanderChevronBackground}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandCollapseChevron" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorSecondary}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextFillColorSecondaryBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<VisualState.Setters>
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/PaneHolderPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<icore:ChangePropertyAction
PropertyName="CurrentInstanceBorderBrush"
TargetObject="{Binding ElementName=PaneLeft}"
Value="{ThemeResource DividerStrokeColorDefault}" />
Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
<icore:ChangePropertyAction
PropertyName="CurrentInstanceBorderThickness"
TargetObject="{Binding ElementName=PaneLeft}"
Expand All @@ -142,7 +142,7 @@
<icore:ChangePropertyAction
PropertyName="CurrentInstanceBorderBrush"
TargetObject="{Binding ElementName=PaneRight}"
Value="{ThemeResource DividerStrokeColorDefault}" />
Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
<icore:ChangePropertyAction
PropertyName="CurrentInstanceBorderThickness"
TargetObject="{Binding ElementName=PaneRight}"
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/Properties/GeneralPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
Grid.ColumnSpan="2"
Height="1"
Margin="-16,0"
Background="{ThemeResource DividerStrokeColorDefault}" />
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />

<!-- Date Created -->
<TextBlock
Expand Down Expand Up @@ -714,7 +714,7 @@
Grid.ColumnSpan="3"
Height="1"
Margin="-16,0"
Background="{ThemeResource DividerStrokeColorDefault}" />
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />

<!-- Hidden -->
<TextBlock
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/Properties/MainPropertiesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<!-- Save/Cancel buttons -->
<Grid
Grid.Row="1"
Background="{ThemeResource CardBackgroundFillColorSecondary}"
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0">
<StackPanel
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Views/Properties/SecurityAdvancedPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
Text="{helpers:ResourceString Name=Type}"
TextTrimming="CharacterEllipsis"
Expand All @@ -289,7 +289,7 @@
Margin="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
Text="{helpers:ResourceString Name=Principal}"
TextTrimming="CharacterEllipsis"
Expand All @@ -305,7 +305,7 @@
Margin="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
Text="{helpers:ResourceString Name=Access}"
TextTrimming="CharacterEllipsis"
Expand All @@ -321,7 +321,7 @@
Margin="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
Text="{helpers:ResourceString Name=Inherited}"
TextTrimming="CharacterEllipsis"
Expand All @@ -337,7 +337,7 @@
Margin="4,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondary}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource App.Theme.CaptionTextBlockStyle}"
Text="{helpers:ResourceString Name=SecurityAdvancedAppliesTo}"
TextTrimming="CharacterEllipsis"
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/Properties/SecurityPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<Border
Grid.Row="1"
Height="1"
Background="{ThemeResource DividerStrokeColorDefault}" />
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />

<!-- Access Control Entries List -->
<ScrollViewer
Expand Down Expand Up @@ -230,7 +230,7 @@
Grid.Row="1"
Height="1"
Margin="-12,0"
Background="{ThemeResource DividerStrokeColorDefault}" />
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />

<!-- Permission Allow/Deny CheckBoxes -->
<Grid
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Views/Settings/AppearancePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
Width="32"
Height="12"
VerticalAlignment="Bottom"
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefault}"
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="1,1,1,0"
CornerRadius="4,4,0,0" />
Expand All @@ -70,7 +70,7 @@
Grid.Row="1"
Height="50"
VerticalAlignment="Bottom"
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefault}"
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="0,0,0,.5" />

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/Settings/TagsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
x:Name="AddTagGrid"
Padding="32,12"
x:Load="{x:Bind ViewModel.IsCreatingNewTag, Mode=OneWay}"
Background="{ThemeResource CardBackgroundFillColorDefault}"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="0,0,0,1">
<Grid.ColumnDefinitions>
Expand Down