From 37050a51ce9d49df0ae6e8c980085e36f4915d00 Mon Sep 17 00:00:00 2001 From: Gaoyang Date: Wed, 11 Nov 2026 16:32:04 +0800 Subject: [PATCH] fix: unify window button sizes and use per-style caption icons The close glyph defaulted to 16 while minimize/maximize used 12, so it looked larger than its neighbours. All window buttons are now 40x40 with 16 icons, matching the sidebar tool buttons. Dialog title bars grow from 40 to 48 (and CaptionHeight with them) so the round close button no longer touches the top edge; DiskContentDialog's fixed height grows by the same 8 px. Caption glyphs and colours now come from the current style: style B uses rounder glyphs in amber/green/red, style C keeps the thin monochrome set. The maximize/restore glyph switch moves from code-behind into a WindowState trigger so it follows style changes, and the close glyph turns white on its red hover. PaletteKeysTests covers the new keys. --- src/ManagedDrive.App/MainWindow.xaml | 6 +-- src/ManagedDrive.App/MainWindow.xaml.cs | 10 ---- src/ManagedDrive.App/Themes/AppTheme.xaml | 36 ++++++++++++- .../Themes/Styles/AppStyle.A.xaml | 9 ++++ .../Themes/Styles/AppStyle.B.Colors.Dark.xaml | 5 ++ .../Styles/AppStyle.B.Colors.Light.xaml | 5 ++ .../Themes/Styles/AppStyle.B.xaml | 8 +++ .../Themes/Styles/AppStyle.C.Colors.Dark.xaml | 5 ++ .../Styles/AppStyle.C.Colors.Light.xaml | 5 ++ .../Views/DialogWindowBase.cs | 2 +- .../Views/DiskContentDialog.xaml | 2 +- .../Views/DiskContentDialog.xaml.cs | 2 +- .../Views/SpaceUsageDialog.xaml.cs | 2 +- .../Themes/PaletteKeysTests.cs | 50 +++++++++++++++++++ 14 files changed, 128 insertions(+), 19 deletions(-) diff --git a/src/ManagedDrive.App/MainWindow.xaml b/src/ManagedDrive.App/MainWindow.xaml index 5b6a29c..6dd4f75 100644 --- a/src/ManagedDrive.App/MainWindow.xaml +++ b/src/ManagedDrive.App/MainWindow.xaml @@ -134,19 +134,19 @@ Click="MinimizeButton_Click" ToolTip="{DynamicResource Tip.Minimize}" AutomationProperties.Name="{DynamicResource Tip.Minimize}"> - + diff --git a/src/ManagedDrive.App/MainWindow.xaml.cs b/src/ManagedDrive.App/MainWindow.xaml.cs index 73d754f..10c2cb9 100644 --- a/src/ManagedDrive.App/MainWindow.xaml.cs +++ b/src/ManagedDrive.App/MainWindow.xaml.cs @@ -16,8 +16,6 @@ public MainWindow(MainViewModel viewModel) InitializeComponent(); DataContext = viewModel; WindowMaximizeHelper.HookMaximizeBehavior(this); - StateChanged += (_, _) => UpdateMaximizeIcon(); - UpdateMaximizeIcon(); } private void CloseButton_Click(object sender, RoutedEventArgs e) => Close(); @@ -27,14 +25,6 @@ public MainWindow(MainViewModel viewModel) private void MaximizeButton_Click(object sender, RoutedEventArgs e) => WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; - /// - /// Swaps the caption button's glyph between "maximize" and "restore" to match the current - /// , since it toggles between the two rather than having - /// separate buttons for each. - /// - private void UpdateMaximizeIcon() => - MaximizeIcon.Text = WindowState == WindowState.Maximized ? "" : ""; - /// /// Keeps the selected disk in view: a clicked notification can select one that is scrolled away. /// diff --git a/src/ManagedDrive.App/Themes/AppTheme.xaml b/src/ManagedDrive.App/Themes/AppTheme.xaml index 574bee1..0c42f15 100644 --- a/src/ManagedDrive.App/Themes/AppTheme.xaml +++ b/src/ManagedDrive.App/Themes/AppTheme.xaml @@ -99,6 +99,38 @@ + + + + + + + + +