From 8e0f0450dfced645f2ea1d716cc28412d0103cb2 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 4 Oct 2025 17:30:26 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainWindow_cs/MW_FloatingBarIcons.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 50f023de..fc90338a 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -3714,6 +3714,35 @@ namespace Ink_Canvas break; } + // 根据主题设置高光颜色 + Color highlightBackgroundColor; + Color highlightBarColor; + bool isDarkTheme = Settings.Appearance.Theme == 1 || + (Settings.Appearance.Theme == 2 && !IsSystemThemeLight()); + + if (isDarkTheme) + { + highlightBackgroundColor = Color.FromArgb(21, 102, 204, 255); + highlightBarColor = Color.FromRgb(102, 204, 255); + } + else + { + highlightBackgroundColor = Color.FromArgb(21, 59, 130, 246); + highlightBarColor = Color.FromRgb(37, 99, 235); + } + + // 设置高光背景颜色 + FloatingbarSelectionBG.Background = new SolidColorBrush(highlightBackgroundColor); + + if (FloatingbarSelectionBG.Child is System.Windows.Controls.Canvas canvas && canvas.Children.Count > 0) + { + var firstChild = canvas.Children[0]; + if (firstChild is Border innerBorder) + { + innerBorder.Background = new SolidColorBrush(highlightBarColor); + } + } + // 设置高光位置 FloatingbarSelectionBG.Visibility = Visibility.Visible; System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, position);