improve:主题切换
This commit is contained in:
@@ -155,8 +155,19 @@ namespace Ink_Canvas
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 选中状态的颜色(蓝底)
|
// 根据主题选择高光颜色
|
||||||
var selectedColor = Color.FromRgb(30, 58, 138);
|
Color selectedColor;
|
||||||
|
bool isDarkTheme = Settings.Appearance.Theme == 1 ||
|
||||||
|
(Settings.Appearance.Theme == 2 && !IsSystemThemeLight());
|
||||||
|
|
||||||
|
if (isDarkTheme)
|
||||||
|
{
|
||||||
|
selectedColor = Color.FromRgb(102, 204, 255);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selectedColor = Color.FromRgb(30, 58, 138);
|
||||||
|
}
|
||||||
|
|
||||||
// 根据当前模式设置按钮颜色
|
// 根据当前模式设置按钮颜色
|
||||||
switch (_currentToolMode)
|
switch (_currentToolMode)
|
||||||
|
|||||||
@@ -475,12 +475,26 @@ namespace Ink_Canvas
|
|||||||
HideFloatingBarHighlight();
|
HideFloatingBarHighlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据主题选择高光颜色
|
||||||
|
Color highlightColor;
|
||||||
|
bool isDarkTheme = Settings.Appearance.Theme == 1 ||
|
||||||
|
(Settings.Appearance.Theme == 2 && !IsSystemThemeLight());
|
||||||
|
|
||||||
|
if (isDarkTheme)
|
||||||
|
{
|
||||||
|
highlightColor = Color.FromRgb(102, 204, 255); // #66ccff for dark theme
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
highlightColor = Color.FromRgb(30, 58, 138); // Keep current color for light theme
|
||||||
|
}
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case "pen":
|
case "pen":
|
||||||
case "color":
|
case "color":
|
||||||
{
|
{
|
||||||
PenIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
PenIconGeometry.Brush = new SolidColorBrush(highlightColor);
|
||||||
PenIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("pen", true));
|
PenIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("pen", true));
|
||||||
BoardPen.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
BoardPen.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||||
BoardPen.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
BoardPen.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||||
@@ -492,7 +506,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
case "eraser":
|
case "eraser":
|
||||||
{
|
{
|
||||||
CircleEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
CircleEraserIconGeometry.Brush = new SolidColorBrush(highlightColor);
|
||||||
CircleEraserIconGeometry.Geometry =
|
CircleEraserIconGeometry.Geometry =
|
||||||
Geometry.Parse(GetCorrectIcon("eraserCircle", true));
|
Geometry.Parse(GetCorrectIcon("eraserCircle", true));
|
||||||
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||||
@@ -505,7 +519,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
case "eraserByStrokes":
|
case "eraserByStrokes":
|
||||||
{
|
{
|
||||||
StrokeEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
StrokeEraserIconGeometry.Brush = new SolidColorBrush(highlightColor);
|
||||||
StrokeEraserIconGeometry.Geometry =
|
StrokeEraserIconGeometry.Geometry =
|
||||||
Geometry.Parse(GetCorrectIcon("eraserStroke", true));
|
Geometry.Parse(GetCorrectIcon("eraserStroke", true));
|
||||||
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||||
@@ -518,7 +532,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
case "select":
|
case "select":
|
||||||
{
|
{
|
||||||
LassoSelectIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
LassoSelectIconGeometry.Brush = new SolidColorBrush(highlightColor);
|
||||||
LassoSelectIconGeometry.Geometry =
|
LassoSelectIconGeometry.Geometry =
|
||||||
Geometry.Parse(GetCorrectIcon("lassoSelect", true));
|
Geometry.Parse(GetCorrectIcon("lassoSelect", true));
|
||||||
BoardSelect.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
BoardSelect.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||||
@@ -531,7 +545,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
case "cursor":
|
case "cursor":
|
||||||
{
|
{
|
||||||
CursorIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
CursorIconGeometry.Brush = new SolidColorBrush(highlightColor);
|
||||||
CursorIconGeometry.Geometry =
|
CursorIconGeometry.Geometry =
|
||||||
Geometry.Parse(GetCorrectIcon("cursor", true));
|
Geometry.Parse(GetCorrectIcon("cursor", true));
|
||||||
// 根据主题设置颜色
|
// 根据主题设置颜色
|
||||||
|
|||||||
Reference in New Issue
Block a user