From 8d26010db561d6ea542d4cf48fe37227d9bb4a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20B=C3=A1lint=20Hunor?= Date: Mon, 12 Oct 2026 16:59:49 +0300 Subject: [PATCH] Fix Linux flyout backgrounds and Properties backdrop Co-Authored-By: Codex Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_016FAtbHHLQSiJiYcw2vnKiq --- src/Files.App/App.xaml | 3 +++ src/Files.App/Styles/LinuxDesktopResources.xaml | 7 +++++++ .../Utils/Storage/Helpers/FilePropertiesHelpers.cs | 8 ++++++++ src/Files.App/Views/MainPage.xaml | 8 ++++++++ src/Files.App/Views/MainPage.xaml.cs | 8 ++++++++ src/Files.App/Views/Properties/MainPropertiesPage.xaml | 2 +- 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Files.App/App.xaml b/src/Files.App/App.xaml index 049a51b32334..f349ebdf88c6 100644 --- a/src/Files.App/App.xaml +++ b/src/Files.App/App.xaml @@ -24,12 +24,15 @@ 2 + diff --git a/src/Files.App/Styles/LinuxDesktopResources.xaml b/src/Files.App/Styles/LinuxDesktopResources.xaml index 9ca9e80d1018..51bc8a9af3b5 100644 --- a/src/Files.App/Styles/LinuxDesktopResources.xaml +++ b/src/Files.App/Styles/LinuxDesktopResources.xaml @@ -280,6 +280,8 @@ + + @@ -299,6 +301,8 @@ + + @@ -314,6 +318,9 @@ + + + diff --git a/src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs b/src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs index 635d9d5691ef..850743554a2d 100644 --- a/src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs +++ b/src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs @@ -1,6 +1,7 @@ // Copyright (c) Files Community // Licensed under the MIT License. +using CommunityToolkit.WinUI; using Files.App.Views.Properties; using Microsoft.UI; using Microsoft.UI.Windowing; @@ -159,6 +160,13 @@ public static void OpenPropertiesWindow(object item, IShellPage associatedInstan appWindow.Show(); + if (OperatingSystem.IsLinux() && associatedInstance is FrameworkElement ownerElement && + ownerElement.FindAscendant() is { } ownerPage) + { + ownerPage.UpdatePropertiesBackdrop(true); + propertiesWindow.Closed += (_, _) => ownerPage.UpdatePropertiesBackdrop(false); + } + (frame.Content as MainPropertiesPage)?.TryNavigateToPage(defaultPage); } diff --git a/src/Files.App/Views/MainPage.xaml b/src/Files.App/Views/MainPage.xaml index 429f59714ca7..2e84d4c1fac0 100644 --- a/src/Files.App/Views/MainPage.xaml +++ b/src/Files.App/Views/MainPage.xaml @@ -361,6 +361,14 @@ IsOpen="{x:Bind ViewModel.ShowSponsorPrompt, Mode=OneWay}" Subtitle="{helpers:ResourceString Key=SponsorSubtitle}" /> + + + diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index 58e2d748ab90..fbd6b97581f7 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -32,6 +32,14 @@ public sealed partial class MainPage : Page public MainPageViewModel ViewModel { get; } + private int openPropertiesWindowCount; + + internal void UpdatePropertiesBackdrop(bool opening) + { + openPropertiesWindowCount = Math.Max(0, openPropertiesWindowCount + (opening ? 1 : -1)); + PropertiesSmokeLayer.Visibility = openPropertiesWindowCount > 0 ? Visibility.Visible : Visibility.Collapsed; + } + private bool keyReleased = true; private DispatcherQueueTimer _updateDateDisplayTimer; diff --git a/src/Files.App/Views/Properties/MainPropertiesPage.xaml b/src/Files.App/Views/Properties/MainPropertiesPage.xaml index 34c43658ae8f..8e89537c6c9f 100644 --- a/src/Files.App/Views/Properties/MainPropertiesPage.xaml +++ b/src/Files.App/Views/Properties/MainPropertiesPage.xaml @@ -9,7 +9,7 @@ xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:Files.App.ViewModels.Properties" - Background="{ThemeResource App.Theme.BackgroundBrush}" + Background="{ThemeResource Files.Linux.FlyoutSurfaceBrush}" DataContext="{x:Bind MainPropertiesViewModel, Mode=OneWay}" HighContrastAdjustment="None" KeyDown="Page_KeyDown"