add:老版UI切换
This commit is contained in:
@@ -429,17 +429,17 @@ namespace Ink_Canvas
|
||||
if (mode != "clear")
|
||||
{
|
||||
CursorIconGeometry.Brush = new SolidColorBrush(FloatBarForegroundColor);
|
||||
CursorIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedCursorIcon);
|
||||
CursorIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("cursor", false));
|
||||
PenIconGeometry.Brush = new SolidColorBrush(FloatBarForegroundColor);
|
||||
PenIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedPenIcon);
|
||||
PenIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("pen", false));
|
||||
StrokeEraserIconGeometry.Brush = new SolidColorBrush(FloatBarForegroundColor);
|
||||
StrokeEraserIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.LinedEraserStrokeIcon);
|
||||
Geometry.Parse(GetCorrectIcon("eraserStroke", false));
|
||||
CircleEraserIconGeometry.Brush = new SolidColorBrush(FloatBarForegroundColor);
|
||||
CircleEraserIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.LinedEraserCircleIcon);
|
||||
Geometry.Parse(GetCorrectIcon("eraserCircle", false));
|
||||
LassoSelectIconGeometry.Brush = new SolidColorBrush(FloatBarForegroundColor);
|
||||
LassoSelectIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedLassoSelectIcon);
|
||||
LassoSelectIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("lassoSelect", false));
|
||||
|
||||
// 根据主题设置颜色
|
||||
if (Settings.Appearance.Theme == 1) // 深色主题
|
||||
@@ -482,7 +482,7 @@ namespace Ink_Canvas
|
||||
case "color":
|
||||
{
|
||||
PenIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
||||
PenIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.SolidPenIcon);
|
||||
PenIconGeometry.Geometry = Geometry.Parse(GetCorrectIcon("pen", true));
|
||||
BoardPen.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardPen.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardPenGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
|
||||
@@ -495,7 +495,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
CircleEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
||||
CircleEraserIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.SolidEraserCircleIcon);
|
||||
Geometry.Parse(GetCorrectIcon("eraserCircle", true));
|
||||
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardEraser.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardEraserGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
|
||||
@@ -508,7 +508,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
StrokeEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
||||
StrokeEraserIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.SolidEraserStrokeIcon);
|
||||
Geometry.Parse(GetCorrectIcon("eraserStroke", true));
|
||||
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardEraser.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardEraserGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
|
||||
@@ -521,7 +521,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
LassoSelectIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
||||
LassoSelectIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.SolidLassoSelectIcon);
|
||||
Geometry.Parse(GetCorrectIcon("lassoSelect", true));
|
||||
BoardSelect.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardSelect.BorderBrush = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardSelectGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
|
||||
@@ -534,7 +534,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
CursorIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
|
||||
CursorIconGeometry.Geometry =
|
||||
Geometry.Parse(XamlGraphicsIconGeometries.LinedCursorIcon);
|
||||
Geometry.Parse(GetCorrectIcon("cursor", true));
|
||||
// 根据主题设置颜色
|
||||
if (Settings.Appearance.Theme == 1) // 深色主题
|
||||
{
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
public static string LinedCursorIcon =
|
||||
"F1 M24,24z M0,0z M5.72106,15.9716L3.71327,3.00395C3.6389,2.6693 3.65747,2.41831 3.76902,2.25099 3.88057,2.08366 4.0479,2 4.271,2 4.4941,2 4.71711,2.07437 4.94021,2.2231 6.72502,3.39438 9.28149,5.10481 12.6094,7.3544 15.677,9.45526 18.1125,11.1285 19.9159,12.3742 20.1204,12.5229 20.2505,12.6995 20.3062,12.904 20.362,13.1085 20.3249,13.2944 20.1947,13.4618 20.0832,13.6105 19.8973,13.6849 19.637,13.6849L13.3902,13.6849 17.6291,19.7365C17.722,19.8666 17.75,20.0153 17.7128,20.1827 17.6942,20.3314 17.6198,20.4522 17.4897,20.5452L15.5654,21.8838C15.4353,21.9768 15.2865,22.0139 15.1192,21.9953 14.9704,21.9582 14.8496,21.8745 14.7566,21.7444L10.2389,15.2745 7.58956,19.9038C7.45942,20.1269 7.30144,20.2756 7.11552,20.35 6.92961,20.4058 6.75292,20.3872 6.5856,20.2942 6.43686,20.2013 6.34392,20.0339 6.30673,19.7922L6.00007,17.8959C5.88852,17.0779,5.79543,16.4364,5.72106,15.9716z";
|
||||
|
||||
public static string SolidCursorIcon =
|
||||
"F1 M24,24z M0,0z M5.72106,15.9716L3.71327,3.00395C3.6389,2.6693 3.65747,2.41831 3.76902,2.25099 3.88057,2.08366 4.0479,2 4.271,2 4.4941,2 4.71711,2.07437 4.94021,2.2231 6.72502,3.39438 9.28149,5.10481 12.6094,7.3544 15.677,9.45526 18.1125,11.1285 19.9159,12.3742 20.1204,12.5229 20.2505,12.6995 20.3062,12.904 20.362,13.1085 20.3249,13.2944 20.1947,13.4618 20.0832,13.6105 19.8973,13.6849 19.637,13.6849L13.3902,13.6849 17.6291,19.7365C17.722,19.8666 17.75,20.0153 17.7128,20.1827 17.6942,20.3314 17.6198,20.4522 17.4897,20.5452L15.5654,21.8838C15.4353,21.9768 15.2865,22.0139 15.1192,21.9953 14.9704,21.9582 14.8496,21.8745 14.7566,21.7444L10.2389,15.2745 7.58956,19.9038C7.45942,20.1269 7.30144,20.2756 7.11552,20.35 6.92961,20.4058 6.75292,20.3872 6.5856,20.2942 6.43686,20.2013 6.34392,20.0339 6.30673,19.7922L6.00007,17.8959C5.88852,17.0779,5.79543,16.4364,5.72106,15.9716z";
|
||||
|
||||
public static string LinedPenIcon =
|
||||
"F1 M24,24z M0,0z M16.996,2.34419L21.6823,7.00397C21.8941,7.23343 22,7.49819 22,7.79825 22,8.09831 21.8941,8.35425 21.6823,8.56606L10.8271,19.4212 4.57877,13.1994 15.4339,2.34419C15.6457,2.11473 15.9017,2 16.2018,2 16.5195,2 16.7842,2.11473 16.996,2.34419z M9.63571,20.5862L9.50333,20.6391 2.6725,21.9894C2.47834,22.0247 2.31066,21.9718 2.16946,21.8306 2.02825,21.707 1.97529,21.5481 2.01059,21.354L3.38736,14.5232C3.38736,14.4879,3.40502,14.4349,3.44032,14.3643L9.63571,20.5862z";
|
||||
|
||||
|
||||
@@ -2614,6 +2614,45 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
public string GetCorrectIcon(string iconType, bool isSolid = false)
|
||||
{
|
||||
if (Settings.Appearance.UseLegacyFloatingBarUI)
|
||||
{
|
||||
// 使用老版图标
|
||||
switch (iconType)
|
||||
{
|
||||
case "cursor":
|
||||
return isSolid ? XamlGraphicsIconGeometries.LegacySolidCursorIcon : XamlGraphicsIconGeometries.LegacyLinedCursorIcon;
|
||||
case "pen":
|
||||
return isSolid ? XamlGraphicsIconGeometries.LegacySolidPenIcon : XamlGraphicsIconGeometries.LegacyLinedPenIcon;
|
||||
case "eraserStroke":
|
||||
return isSolid ? XamlGraphicsIconGeometries.LegacySolidEraserStrokeIcon : XamlGraphicsIconGeometries.LegacyLinedEraserStrokeIcon;
|
||||
case "eraserCircle":
|
||||
return isSolid ? XamlGraphicsIconGeometries.LegacySolidEraserCircleIcon : XamlGraphicsIconGeometries.LegacyLinedEraserCircleIcon;
|
||||
case "lassoSelect":
|
||||
return isSolid ? XamlGraphicsIconGeometries.LegacySolidLassoSelectIcon : XamlGraphicsIconGeometries.LegacyLinedLassoSelectIcon;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 使用新版图标
|
||||
switch (iconType)
|
||||
{
|
||||
case "cursor":
|
||||
return isSolid ? XamlGraphicsIconGeometries.SolidCursorIcon : XamlGraphicsIconGeometries.LinedCursorIcon;
|
||||
case "pen":
|
||||
return isSolid ? XamlGraphicsIconGeometries.SolidPenIcon : XamlGraphicsIconGeometries.LinedPenIcon;
|
||||
case "eraserStroke":
|
||||
return isSolid ? XamlGraphicsIconGeometries.SolidEraserStrokeIcon : XamlGraphicsIconGeometries.LinedEraserStrokeIcon;
|
||||
case "eraserCircle":
|
||||
return isSolid ? XamlGraphicsIconGeometries.SolidEraserCircleIcon : XamlGraphicsIconGeometries.LinedEraserCircleIcon;
|
||||
case "lassoSelect":
|
||||
return isSolid ? XamlGraphicsIconGeometries.SolidLassoSelectIcon : XamlGraphicsIconGeometries.LinedLassoSelectIcon;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 浮动栏按钮显示控制
|
||||
|
||||
Reference in New Issue
Block a user