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);