From 93d538f2b7486e2588a154d832a76b17c9a77896 Mon Sep 17 00:00:00 2001 From: SantanuDatta Date: Sat, 7 Nov 2026 18:33:40 +0600 Subject: [PATCH 1/3] fix(windows): polish settings and tray UI Improve alignment and spacing, service filter presentation, title-bar theme contrast, About logo loading, and action menu placement and readability. Refs flock-php/flock#122 --- windows/Flock.Screenshots/Screenshots.cs | 3 + windows/Flock.Tray/FlockWindow.xaml.cs | 18 ++ windows/Flock.Tray/PanelWindow.xaml | 12 +- windows/Flock.Tray/Settings/AboutPane.xaml | 26 +-- windows/Flock.Tray/Settings/AboutPane.xaml.cs | 4 +- windows/Flock.Tray/Settings/AiPane.xaml | 4 +- windows/Flock.Tray/Settings/DebuggerPane.xaml | 22 +- windows/Flock.Tray/Settings/DumpsPane.xaml | 8 +- windows/Flock.Tray/Settings/GeneralPane.xaml | 22 +- windows/Flock.Tray/Settings/MailPane.xaml | 10 +- windows/Flock.Tray/Settings/NodePane.xaml.cs | 10 +- windows/Flock.Tray/Settings/PhpPane.xaml.cs | 17 +- windows/Flock.Tray/Settings/ServicesPane.xaml | 198 +++++++++++++----- .../Flock.Tray/Settings/ServicesPane.xaml.cs | 9 +- .../Flock.Tray/Settings/SettingsWindow.xaml | 6 +- .../Settings/SettingsWindow.xaml.cs | 2 +- windows/Flock.Tray/Ui.cs | 14 ++ 17 files changed, 270 insertions(+), 115 deletions(-) diff --git a/windows/Flock.Screenshots/Screenshots.cs b/windows/Flock.Screenshots/Screenshots.cs index ab42ea52..10ecc823 100644 --- a/windows/Flock.Screenshots/Screenshots.cs +++ b/windows/Flock.Screenshots/Screenshots.cs @@ -13,6 +13,7 @@ internal sealed class Screenshots(Screenshots.Options options) private static readonly Shot[] All = [ new("settings-general-project-folders", app => app.ShowSettings(SettingsPane.General, "Updates")), + new("settings-general-daemon", app => app.ShowSettings(SettingsPane.General)), new("settings-sites", app => app.ShowSite("shop")), new("settings-sites-https", app => app.ShowSite("acme")), new("settings-sites-add-domain", app => app.ShowAddDomain("acme", "admin")), @@ -24,6 +25,8 @@ internal sealed class Screenshots(Screenshots.Options options) new("settings-services-postgres", app => app.ShowService("postgres")), new("settings-services-install", app => app.ShowService("mariadb")), new("settings-debugger", app => app.ShowSettings(SettingsPane.Debugger)), + new("settings-mail", app => app.ShowSettings(SettingsPane.Mail)), + new("settings-about", app => app.ShowSettings(SettingsPane.About)), new("logs-window", app => app.ShowLog("acme")), new("mail-window", app => app.ShowMail()), new("dumps-window", app => app.ShowWindow(WindowKind.Dumps)), diff --git a/windows/Flock.Tray/FlockWindow.xaml.cs b/windows/Flock.Tray/FlockWindow.xaml.cs index ba5962c8..8e2016ee 100644 --- a/windows/Flock.Tray/FlockWindow.xaml.cs +++ b/windows/Flock.Tray/FlockWindow.xaml.cs @@ -67,6 +67,24 @@ protected void InitializeChrome(Grid root, Grid titleBar, TextBlock caption, Ima ExtendsContentIntoTitleBar = true; AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall; SetTitleBar(titleBar); + root.Loaded += (_, _) => UpdateTitleBarTheme(root); + root.ActualThemeChanged += (sender, _) => UpdateTitleBarTheme(sender); + UpdateTitleBarTheme(root); + } + + private void UpdateTitleBarTheme(FrameworkElement root) + { + var light = root.ActualTheme == ElementTheme.Light; + var titleBar = AppWindow.TitleBar; + var foreground = light ? Colors.Black : Colors.White; + titleBar.ButtonForegroundColor = foreground; + titleBar.ButtonHoverForegroundColor = foreground; + titleBar.ButtonPressedForegroundColor = foreground; + titleBar.ButtonInactiveForegroundColor = Colors.Gray; + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; + titleBar.ButtonHoverBackgroundColor = light ? Microsoft.UI.ColorHelper.FromArgb(255, 230, 230, 230) : Microsoft.UI.ColorHelper.FromArgb(255, 55, 55, 55); + titleBar.ButtonPressedBackgroundColor = light ? Microsoft.UI.ColorHelper.FromArgb(255, 240, 240, 240) : Microsoft.UI.ColorHelper.FromArgb(255, 45, 45, 45); } private static string DisplayTitle(string title) => App.Current.Options.Identity.IsDevelopment ? title + " [Dev]" : title; diff --git a/windows/Flock.Tray/PanelWindow.xaml b/windows/Flock.Tray/PanelWindow.xaml index 36e85e20..c2e985f6 100644 --- a/windows/Flock.Tray/PanelWindow.xaml +++ b/windows/Flock.Tray/PanelWindow.xaml @@ -272,22 +272,22 @@ - + - + - + - + - + - + diff --git a/windows/Flock.Tray/Settings/AboutPane.xaml b/windows/Flock.Tray/Settings/AboutPane.xaml index 8a317327..e37f5b88 100644 --- a/windows/Flock.Tray/Settings/AboutPane.xaml +++ b/windows/Flock.Tray/Settings/AboutPane.xaml @@ -4,7 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - + - + @@ -25,7 +25,7 @@ - + @@ -33,11 +33,11 @@ - + - @@ -73,11 +73,11 @@ - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/windows/Flock.Tray/Settings/ServicesPane.xaml.cs b/windows/Flock.Tray/Settings/ServicesPane.xaml.cs index 2f7b67ef..211e80fe 100644 --- a/windows/Flock.Tray/Settings/ServicesPane.xaml.cs +++ b/windows/Flock.Tray/Settings/ServicesPane.xaml.cs @@ -80,9 +80,9 @@ public void Select(string id) rows.SelectedId = id; } - private void FilterChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs args) + private void FilterChanged(object sender, RoutedEventArgs args) { - rows.ShowAll = sender.SelectedItem == Filter.Items[1]; + rows.ShowAll = ReferenceEquals(sender, AllFilter); } private void ModelChanged() @@ -103,7 +103,8 @@ private void ServiceSelected(object sender, RoutedEventArgs args) private void SelectedServiceChanged(ServiceViewModel? service) { - Filter.SelectedItem = Filter.Items[rows.ShowAll ? 1 : 0]; + AllFilter.IsChecked = rows.ShowAll; + InstalledFilter.IsChecked = !rows.ShowAll; if (service is null) { DetailHost.Content = Ui.EmptyState(Ui.GlyphServer, "No services"); @@ -351,4 +352,4 @@ private async Task EditPort(Service service) else await Model.Services.SetPortAsync(service.Id, port); } } -} \ No newline at end of file +} diff --git a/windows/Flock.Tray/Settings/SettingsWindow.xaml b/windows/Flock.Tray/Settings/SettingsWindow.xaml index 08a4cced..b7299832 100644 --- a/windows/Flock.Tray/Settings/SettingsWindow.xaml +++ b/windows/Flock.Tray/Settings/SettingsWindow.xaml @@ -3,7 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Flock.Tray"> - + @@ -82,7 +82,7 @@ - + @@ -103,4 +103,4 @@ - \ No newline at end of file + diff --git a/windows/Flock.Tray/Settings/SettingsWindow.xaml.cs b/windows/Flock.Tray/Settings/SettingsWindow.xaml.cs index 59674ead..2c20b4a9 100644 --- a/windows/Flock.Tray/Settings/SettingsWindow.xaml.cs +++ b/windows/Flock.Tray/Settings/SettingsWindow.xaml.cs @@ -290,4 +290,4 @@ public override async Task ReleaseAsync() } await base.ReleaseAsync(); } -} \ No newline at end of file +} diff --git a/windows/Flock.Tray/Ui.cs b/windows/Flock.Tray/Ui.cs index ef5d238d..8a0e4180 100644 --- a/windows/Flock.Tray/Ui.cs +++ b/windows/Flock.Tray/Ui.cs @@ -55,6 +55,20 @@ internal static class Ui public static Brush Brush(string key) => Resource(key); + /// Uses the flyout palette without depending on an acrylic backdrop behind a constrained popup. + public static Style OpaqueMenuPresenterStyle() + { + var background = Brush("AcrylicBackgroundFillColorDefaultBrush"); + return new Style(typeof(MenuFlyoutPresenter)) + { + Setters = + { + new Setter(Control.BackgroundProperty, + background is AcrylicBrush acrylic ? new SolidColorBrush(acrylic.FallbackColor) : background), + }, + }; + } + public static Brush SecondaryText => Brush("TextFillColorSecondaryBrush"); public static Brush TertiaryText => Brush("TextFillColorTertiaryBrush"); public static Brush Success => Brush("SystemFillColorSuccessBrush"); From aa7e44467dea5aa476e84d1f208db94bd3d92653 Mon Sep 17 00:00:00 2001 From: SantanuDatta Date: Sun, 8 Nov 2026 09:58:37 +0600 Subject: [PATCH 2/3] fix(windows): keep Cancel out of destructive dialog styling Scope the red button palette to the destructive action while preserving Cancel as the default. Add a confirmation screenshot check for both themes. --- .../Flock.Screenshots/ScreenshotSession.cs | 24 ++++++++++++++ windows/Flock.Screenshots/Screenshots.cs | 1 + windows/Flock.Tray/Ui.cs | 32 +++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/windows/Flock.Screenshots/ScreenshotSession.cs b/windows/Flock.Screenshots/ScreenshotSession.cs index 08c683d1..95658a97 100644 --- a/windows/Flock.Screenshots/ScreenshotSession.cs +++ b/windows/Flock.Screenshots/ScreenshotSession.cs @@ -79,6 +79,30 @@ internal async Task ShowAddDomain(string site, string domain) return window; } + /// A destructive confirmation, without changing the demo project folders. + internal async Task ShowRemoveProjectFolder() + { + var window = (SettingsWindow)await ShowSettings(SettingsPane.General); + await Settled(); + _ = window.Confirm("Remove C:\\Projects from project folders?", + "Its folders stop being served as sites. Nothing is deleted from disk.", "Remove", true); + await Settled(); + var dialog = VisualTreeHelper.GetOpenPopupsForXamlRoot(window.XamlRoot) + .Select(popup => popup.Child is { } child ? Find(child, _ => true) : null) + .FirstOrDefault(found => found is not null) + ?? throw new InvalidOperationException("The confirmation dialog did not open."); + var remove = Find