improve:主题切换

This commit is contained in:
CJK_mkp
2025-11-01 20:26:52 +08:00
parent 16ae32bfd7
commit 8394e99127
6 changed files with 34 additions and 7 deletions
+1
View File
@@ -421,6 +421,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\new-icons\gesture.png" />
<Resource Include="Resources\new-icons\gesture_white.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\new-icons\gesture-enabled.png" />
+1 -1
View File
@@ -9434,7 +9434,7 @@
MouseUp="TwoFingerGestureBorder_MouseUp" Background="Transparent"
Orientation="Vertical" HorizontalAlignment="Center" Width="36" Margin="0">
<Image x:Name="EnableTwoFingerGestureBtn" Source="/Resources/new-icons/gesture.png"
<Image x:Name="EnableTwoFingerGestureBtn" Source="{DynamicResource GestureIcon}"
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="18"
Margin="0,3,0,0" />
<TextBlock x:Name="gestureiconText" Text="手势" Foreground="{DynamicResource FloatBarForeground}" FontSize="8"
+21
View File
@@ -65,6 +65,9 @@ namespace Ink_Canvas
// 刷新图片选中栏图标
RefreshImageSelectionIcons();
// 刷新手势按钮图标
RefreshGestureButtonIcon();
RefreshFloatingBarHighlightColors();
if (autoSwitchIcon)
@@ -109,6 +112,9 @@ namespace Ink_Canvas
// 刷新图片选中栏图标
RefreshImageSelectionIcons();
// 刷新手势按钮图标
RefreshGestureButtonIcon();
RefreshFloatingBarHighlightColors();
if (autoSwitchIcon)
@@ -492,6 +498,21 @@ namespace Ink_Canvas
}
}
/// <summary>
/// 刷新手势按钮图标
/// </summary>
private void RefreshGestureButtonIcon()
{
try
{
// 调用手势按钮颜色和图标更新方法,该方法会根据当前主题和手势状态设置正确的图标
CheckEnableTwoFingerGestureBtnColorPrompt();
}
catch (Exception)
{
}
}
/// <summary>
/// 刷新其他窗口的主题
/// </summary>
@@ -80,8 +80,7 @@ namespace Ink_Canvas
// 多指书写模式启用时,手势功能被禁用
TwoFingerGestureSimpleStackPanel.Opacity = 0.5;
TwoFingerGestureSimpleStackPanel.IsHitTestVisible = false;
EnableTwoFingerGestureBtn.Source =
new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon");
// 根据主题设置颜色
if (Settings.Appearance.Theme == 1) // 深色主题
@@ -117,8 +116,7 @@ namespace Ink_Canvas
if (hasGestureEnabled)
{
EnableTwoFingerGestureBtn.Source =
new BitmapImage(new Uri("/Resources/new-icons/gesture-enabled.png", UriKind.Relative));
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIconEnabled");
BoardGesture.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
BoardGestureGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
@@ -130,8 +128,7 @@ namespace Ink_Canvas
}
else
{
EnableTwoFingerGestureBtn.Source =
new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon");
// 根据主题设置颜色
if (Settings.Appearance.Theme == 1) // 深色主题
+4
View File
@@ -145,4 +145,8 @@
<BitmapImage x:Key="HandMoveIcon" UriSource="/Resources/new-icons/hand-move_white.png"/>
<BitmapImage x:Key="ZoomIcon" UriSource="/Resources/new-icons/zoom_white.png"/>
<BitmapImage x:Key="RotateIcon" UriSource="/Resources/new-icons/rotate_white.png"/>
<!-- 浮动栏手势按钮图标资源 - 深色主题 -->
<BitmapImage x:Key="GestureIcon" UriSource="/Resources/new-icons/gesture_white.png"/>
<BitmapImage x:Key="GestureIconEnabled" UriSource="/Resources/new-icons/gesture-enabled.png"/>
</ResourceDictionary>
+4
View File
@@ -145,4 +145,8 @@
<BitmapImage x:Key="HandMoveIcon" UriSource="/Resources/new-icons/hand-move.png"/>
<BitmapImage x:Key="ZoomIcon" UriSource="/Resources/new-icons/zoom.png"/>
<BitmapImage x:Key="RotateIcon" UriSource="/Resources/new-icons/rotate.png"/>
<!-- 浮动栏手势按钮图标资源 - 浅色主题 -->
<BitmapImage x:Key="GestureIcon" UriSource="/Resources/new-icons/gesture.png"/>
<BitmapImage x:Key="GestureIconEnabled" UriSource="/Resources/new-icons/gesture-enabled.png"/>
</ResourceDictionary>