improve:主题切换
This commit is contained in:
@@ -3714,6 +3714,35 @@ namespace Ink_Canvas
|
|||||||
break;
|
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;
|
FloatingbarSelectionBG.Visibility = Visibility.Visible;
|
||||||
System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, position);
|
System.Windows.Controls.Canvas.SetLeft(FloatingbarSelectionBG, position);
|
||||||
|
|||||||
Reference in New Issue
Block a user