From ac7e8db516508c3a8e9483599484c9de00fde024 Mon Sep 17 00:00:00 2001 From: lincube Date: Mon, 23 Mar 2026 12:34:04 +0800 Subject: [PATCH] 0.7.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了系统标题栏的问题。 --- LanMountainDesktop/Views/SettingsWindow.axaml | 3 ++- LanMountainDesktop/Views/SettingsWindow.axaml.cs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/LanMountainDesktop/Views/SettingsWindow.axaml b/LanMountainDesktop/Views/SettingsWindow.axaml index f9d88a2..88de880 100644 --- a/LanMountainDesktop/Views/SettingsWindow.axaml +++ b/LanMountainDesktop/Views/SettingsWindow.axaml @@ -36,7 +36,8 @@ - _cachedPages = new(StringComparer.OrdinalIgnoreCase); - private readonly bool _useSystemChrome; + private bool _useSystemChrome; private bool _isResponsiveRefreshPending; private bool _isRestartPromptVisible; @@ -152,12 +152,19 @@ public partial class SettingsWindow : Window, ISettingsPageHostContext public void ApplyChromeMode(bool useSystemChrome) { - if (useSystemChrome || OperatingSystem.IsMacOS()) + _useSystemChrome = useSystemChrome || OperatingSystem.IsMacOS(); + + if (_useSystemChrome) { ExtendClientAreaToDecorationsHint = true; ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.PreferSystemChrome; ExtendClientAreaTitleBarHeightHint = -1; SystemDecorations = SystemDecorations.Full; + + if (WindowTitleBarHost is { }) + { + WindowTitleBarHost.IsVisible = false; + } return; } @@ -165,6 +172,11 @@ public partial class SettingsWindow : Window, ISettingsPageHostContext ExtendClientAreaToDecorationsHint = true; ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; ExtendClientAreaTitleBarHeightHint = 48; + + if (WindowTitleBarHost is { }) + { + WindowTitleBarHost.IsVisible = true; + } } public void RefreshShellText()