From e31dbbcedcaa53c68b9e702f0e908c84d0c34602 Mon Sep 17 00:00:00 2001 From: PrefacedCorg <1876568293@qq.com> Date: Mon, 27 Apr 2026 18:13:44 +0800 Subject: [PATCH] Update MW_FloatingBarIcons.cs --- .../MainWindow_cs/MW_FloatingBarIcons.cs | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index f8300d27..a5a11d03 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -1736,9 +1736,20 @@ namespace Ink_Canvas var windowHandle = new WindowInteropHelper(this).Handle; var screen = Screen.FromHandle(windowHandle); - double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; - // 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响 - var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY); + double screenWidth, screenHeight; + double toolbarHeight; + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && PosXCaculatedWithTaskbarHeight) + { + screenWidth = screen.WorkingArea.Width / dpiScaleX; + screenHeight = screen.WorkingArea.Height / dpiScaleY; + toolbarHeight = 0; + } + else + { + screenWidth = screen.Bounds.Width / dpiScaleX; + screenHeight = screen.Bounds.Height / dpiScaleY; + toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY); + } // 使用更可靠的方法获取浮动栏宽度 double baseWidth = ViewboxFloatingBar.ActualWidth; @@ -1881,9 +1892,20 @@ namespace Ink_Canvas var windowHandle = new WindowInteropHelper(this).Handle; var screen = Screen.FromHandle(windowHandle); - double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; - // 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响 - var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY); + double screenWidth, screenHeight; + double toolbarHeight; + if (Settings.Advanced.IsEnableAvoidFullScreenHelper) + { + screenWidth = screen.WorkingArea.Width / dpiScaleX; + screenHeight = screen.WorkingArea.Height / dpiScaleY; + toolbarHeight = 0; + } + else + { + screenWidth = screen.Bounds.Width / dpiScaleX; + screenHeight = screen.Bounds.Height / dpiScaleY; + toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY); + } double baseWidth = ViewboxFloatingBar.ActualWidth;