refactor(设置): 重构设置窗口为独立窗口并移除旧设置面板
移除旧的内置设置面板及相关代码,将设置功能迁移至独立的设置窗口 优化设置窗口的主题同步功能,调整自动化页面布局
This commit is contained in:
@@ -221,362 +221,6 @@
|
||||
|
||||
<Grid x:Name="Main_Grid">
|
||||
|
||||
<!--// 设置界面 //-->
|
||||
<Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="True"
|
||||
Margin="0,0,0,0">
|
||||
<Border Name="BorderSettings" Background="#ee18181b" ui:ThemeManager.RequestedTheme="Dark" Width="490"
|
||||
HorizontalAlignment="Left" Margin="300,150,0,350" Visibility="Visible">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Navigation Sidebar -->
|
||||
<Border Grid.Column="0" Background="#1e1e1e" BorderBrush="#27272a" BorderThickness="0,0,1,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 顶部Logo区域 -->
|
||||
<Border Grid.Row="0" Height="50" Background="#2d2d30" BorderBrush="#3f3f46" BorderThickness="0,0,0,1">
|
||||
<Image Width="30" Height="30" Source="/Resources/icc.ico" RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||
</Border>
|
||||
|
||||
<!-- 主要导航按钮 -->
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<StackPanel>
|
||||
<!-- Startup -->
|
||||
<Button Width="40" Height="40" Margin="0,10,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavStartup_Click" Tag="startup" ToolTip="{x:Static props:Strings.Nav_Startup}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavStartupIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Canvas -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavCanvas_Click" Tag="canvas" ToolTip="{x:Static props:Strings.Nav_Canvas}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavCanvasIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Crash Action -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavCrashAction_Click" Tag="crashaction" ToolTip="{x:Static props:Strings.Nav_CrashAction}">
|
||||
<Image Width="22" Height="22">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing>
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Brush="White" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round"/>
|
||||
</GeometryDrawing.Pen>
|
||||
<GeometryDrawing.Geometry>
|
||||
<PathGeometry Figures="M10.863 4.09101L2.75699 17.625C2.58988 17.9144 2.50145 18.2425 2.5005 18.5766C2.49954 18.9108 2.58609 19.2394 2.75153 19.5297C2.91698 19.8201 3.15555 20.062 3.44353 20.2316C3.7315 20.4011 4.05884 20.4923 4.39299 20.496H20.607C20.941 20.4922 21.2682 20.401 21.556 20.2315C21.8438 20.062 22.0823 19.8202 22.2477 19.53C22.4131 19.2398 22.4997 18.9114 22.4989 18.5774C22.4981 18.2434 22.4098 17.9154 22.243 17.626L14.137 4.09001C13.9664 3.80851 13.7262 3.57575 13.4394 3.4142C13.1527 3.25266 12.8291 3.16779 12.5 3.16779C12.1709 3.16779 11.8473 3.25266 11.5605 3.4142C11.2738 3.57575 11.0335 3.80851 10.863 4.09001V4.09101Z M9.5 13.5H15.5"/>
|
||||
</GeometryDrawing.Geometry>
|
||||
</GeometryDrawing>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Gesture -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavGesture_Click" Tag="gesture" ToolTip="{i18n:I18n Key=Nav_Gesture_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="F0 M24,24z M0,0z M7.98145,10.6889L7.98145,3.97896C7.98145,3.37896 8.21145,2.80897 8.64145,2.38896 9.49145,1.53896 10.9714,1.53896 11.8214,2.38896 12.2414,2.80897 12.4814,3.37896 12.4814,3.97896L12.4814,6.87304C13.2752,6.60639 14.2109,6.77837 14.8214,7.38896 14.9934,7.56094 15.1352,7.75807 15.2427,7.97211 16.0798,7.5855 17.157,7.72439 17.8214,8.38879 17.9978,8.56516 18.1424,8.76797 18.2509,8.98835 19.0867,8.60643 20.1592,8.74658 20.8214,9.40881 21.2414,9.82881 21.4814,10.3988 21.4814,10.9988L21.4814,15.4988C21.4814,17.2788 20.7614,19.0188 19.5014,20.2688 18.2314,21.5488 16.5314,22.2488 14.7314,22.2488L14.7314,22.2288 12.7314,22.2288 12.6214,22.2288C11.6114,22.1788 10.6214,21.9088 9.73138,21.4288 8.75138,20.8988 7.91138,20.1288 7.29138,19.1988L7.09138,18.8988C6.76138,18.3988 5.68138,16.5088 3.78138,13.1288 3.49138,12.6188 3.41138,12.0188 3.57138,11.4488 3.72138,10.8788 4.08138,10.3988 4.59138,10.0988 5.09138,9.79881 5.68138,9.67881 6.26138,9.74881 6.84138,9.81881 7.38138,10.0888 7.79138,10.4988L7.98145,10.6889z M16.9814,11.0086L16.9814,11.4788C16.9814,11.8888 17.3214,12.2288 17.7314,12.2288 18.1414,12.2288 18.4814,11.8888 18.4814,11.4788L18.4814,10.9889C18.484,10.7926 18.5637,10.6065 18.7014,10.4688 18.9814,10.1888 19.4814,10.1888 19.7614,10.4688 19.9014,10.6088 19.9814,10.7988 19.9814,10.9988L19.9814,15.4988C19.9814,16.8788 19.4214,18.2288 18.4414,19.2088 17.4514,20.1988 16.1314,20.7488 14.7314,20.7488L12.9414,20.7488C12.0714,20.7488 11.2114,20.5288 10.4514,20.1188 9.69138,19.7088 9.04138,19.1088 8.56138,18.3888L8.36138,18.0888C8.06138,17.6188 6.96138,15.7088 5.10138,12.3988 5.00138,12.2288 4.98138,12.0288 5.03138,11.8388 5.08138,11.6488 5.20138,11.4888 5.37138,11.3888 5.58138,11.2588 5.83138,11.2088 6.08138,11.2388 6.32138,11.2688 6.55138,11.3888 6.73138,11.5588L8.20138,13.0288C8.49138,13.3188 8.97138,13.3188 9.26138,13.0288 9.38653,12.9037 9.45767,12.7431 9.4748,12.5778 9.47918,12.5454 9.48145,12.5124 9.48145,12.479L9.48145,3.97896C9.48145,3.77897 9.56145,3.58896 9.70145,3.44896 9.98145,3.16896 10.4814,3.16896 10.7614,3.44896 10.9014,3.58896 10.9814,3.77897 10.9814,3.97896L10.9814,8.97896 10.9814,10.979 10.9814,11.479C10.9814,11.889 11.3214,12.229 11.7314,12.229 12.1414,12.229 12.4814,11.889 12.4814,11.479L12.4814,10.979 12.4814,8.97896C12.4814,8.77897 12.5614,8.58897 12.7014,8.44897 12.9814,8.16897 13.4814,8.16897 13.7614,8.44897 13.9014,8.58897 13.9814,8.77897 13.9814,8.97896L13.9814,9.97879 13.9814,11.479C13.9814,11.889 14.3214,12.229 14.7314,12.229 15.1414,12.229 15.4814,11.889 15.4814,11.479L15.4814,9.97879C15.4814,9.77879 15.5614,9.58879 15.7014,9.44879 15.9814,9.16879 16.4814,9.16879 16.7614,9.44879 16.9014,9.58879 16.9814,9.77879 16.9814,9.97879L16.9814,10.9814 16.9814,10.9988 16.9814,11.0086z M3.27144,5.81876C3.04144,5.81876 2.81144,5.70876 2.66144,5.50876 2.42144,5.17876 2.49144,4.70876 2.82144,4.45876 3.63144,3.86876 4.50144,3.35876 5.42144,2.94876 5.80144,2.77876 6.24144,2.94876 6.41144,3.32875 6.58144,3.70876 6.41144,4.14876 6.03144,4.31876 5.21144,4.68876 4.43144,5.13875 3.71144,5.66876 3.58144,5.76876 3.42144,5.80875 3.27144,5.80875L3.27144,5.81876z M18.0113,5.17885C18.1413,5.25885,18.2713,5.29885,18.4113,5.29885L18.4113,5.28885C18.6613,5.28885 18.9113,5.16885 19.0513,4.93885 19.2713,4.58885 19.1613,4.12885 18.8113,3.90885 17.6013,3.14885 16.3013,2.57885 14.9213,2.20885 14.5113,2.09885 14.1113,2.33885 14.0013,2.73885 13.8913,3.13885 14.1313,3.54885 14.5313,3.65885 15.7613,3.98885 16.9313,4.49885 18.0113,5.17885z" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Ink Recognition -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavInkRecognition_Click" Tag="inkrecognition" ToolTip="{x:Static props:Strings.Nav_InkRecognition}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavInkRecognitionIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Theme -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavTheme_Click" Tag="theme" ToolTip="{i18n:I18n Key=Nav_Theme_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavThemeIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- PPT -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavPPT_Click" Tag="ppt" ToolTip="{i18n:I18n Key=Nav_PPT_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavPPTIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Advanced -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavAdvanced_Click" Tag="advanced" ToolTip="{i18n:I18n Key=Nav_Advanced_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavAdvancedIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Automation -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavAutomation_Click" Tag="automation" ToolTip="{i18n:I18n Key=Nav_Automation_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavAutomationIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- Random Window -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavRandomWindow_Click" Tag="randomwindow" ToolTip="{i18n:I18n Key=Nav_RandomWindow_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavRandomWindowIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- About -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavAbout_Click" Tag="about" ToolTip="{x:Static props:Strings.Nav_About}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavAboutIconGeometry}, Converter={StaticResource StringToGeometryConverter}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
<!-- 快捷键设置 -->
|
||||
<Button Width="40" Height="40" Margin="0,5,0,0" Style="{StaticResource NavButton}"
|
||||
Click="NavShortcuts_Click" Tag="shortcuts" ToolTip="{i18n:I18n Key=Nav_Shortcuts_Settings}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.NavShortcutsIconGeometry}, Converter={StaticResource StringToGeometryConverter}}"/>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- 底部操作按钮 -->
|
||||
<StackPanel Grid.Row="2" Margin="0,5,0,10">
|
||||
<Separator Background="#3f3f46" Margin="5,0,5,10"/>
|
||||
|
||||
<!-- 折叠侧边栏按钮 -->
|
||||
<Button Width="40" Height="40" Style="{StaticResource NavButton}"
|
||||
Click="CollapseNavSidebar_Click" ToolTip="{i18n:I18n Key=CollapseNavSidebar}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"/>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Content Area -->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="80"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="50"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题栏 -->
|
||||
<Grid ClipToBounds="True" Grid.Row="0" Margin="0,0,0,0" Height="80" VerticalAlignment="Top">
|
||||
<Border Background="#18181b" CornerRadius="0" Margin="-1,-1,-1,0">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<!-- 显示侧边栏按钮 -->
|
||||
<Button Width="40" Height="40" Margin="10,0,0,0" Style="{StaticResource NavButton}"
|
||||
Click="ShowNavSidebar_Click" ToolTip="{i18n:I18n Key=ShowNavSidebar}">
|
||||
<Image Width="24" Height="24">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"/>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Button>
|
||||
<TextBlock Foreground="White" Margin="15,-2,0,0" Text="{i18n:I18n Key=Settings_Title}" FontWeight="Bold"
|
||||
FontSize="32" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</Border>
|
||||
<Canvas>
|
||||
<Image Canvas.Top="12" Canvas.Right="-16" Width="98" Height="98" Opacity="0.4">
|
||||
<Image.RenderTransform>
|
||||
<!-- giving the transform a name tells the framework not to freeze it -->
|
||||
<RotateTransform CenterX="49" CenterY="49" />
|
||||
</Image.RenderTransform>
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V257 H257 V0 H0 Z">
|
||||
<GeometryDrawing Brush="GhostWhite"
|
||||
Geometry="F0 M257,257z M0,0z M93.339,256.594L88.2444,215.634C85.4849,214.567 82.8846,213.287 80.4434,211.794 78.0023,210.301 75.6142,208.701 73.2793,206.994L35.3887,222.994 0.363831,162.194 33.1598,137.234C32.9476,135.741,32.8414,134.301,32.8414,132.914L32.8414,124.274C32.8414,122.887,32.9476,121.447,33.1598,119.954L0.363831,94.9941 35.3887,34.1941 73.2793,50.1941C75.6142,48.4874 78.0554,46.8874 80.6026,45.3941 83.1499,43.9007 85.6972,42.6207 88.2444,41.5541L93.339,0.594055 163.389,0.594055 168.483,41.5541C171.243,42.6207 173.843,43.9007 176.284,45.3941 178.725,46.8874 181.113,48.4874 183.448,50.1941L221.339,34.1941 256.364,94.9941 223.568,119.954C223.78,121.447,223.886,122.887,223.886,124.274L223.886,132.914C223.886,134.301,223.674,135.741,223.249,137.234L256.045,162.194 221.021,222.994 183.448,206.994C181.113,208.701 178.672,210.301 176.125,211.794 173.578,213.287 171.031,214.567 168.483,215.634L163.389,256.594 93.339,256.594z M160.523,160.274C151.82,169.021 141.312,173.394 129.001,173.394 116.477,173.394 105.916,169.021 97.3191,160.274 88.722,151.527 84.4235,140.967 84.4235,128.594 84.4235,116.221 88.722,105.661 97.3191,96.9141 105.916,88.1674 116.477,83.7941 129.001,83.7941 141.312,83.7941 151.82,88.1674 160.523,96.9141 169.226,105.661 173.578,116.221 173.578,128.594 173.578,140.967 169.226,151.527 160.523,160.274z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetProperty="(Image.RenderTransform).(RotateTransform.Angle)"
|
||||
To="-360" Duration="0:0:3" RepeatBehavior="Forever" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Image.Triggers>
|
||||
</Image>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<ui:ScrollViewerEx Grid.Row="1" Margin="0,0,0,0" VerticalScrollBarVisibility="Auto"
|
||||
PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Dark"
|
||||
ManipulationBoundaryFeedback="SCManipulationBoundaryFeedback"
|
||||
Name="SettingsPanelScrollViewer">
|
||||
<StackPanel Margin="20,20,20,20">
|
||||
|
||||
|
||||
<GroupBox Name="GroupBoxSettings">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Settings_NewWindow}" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="6" Margin="0,10,0,0">
|
||||
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10" Foreground="#fafafa" Text="{i18n:I18n Key=Settings_NewWindowDesc}"/>
|
||||
<Button x:Name="BtnOpenSettings" Content="{i18n:I18n Key=Btn_OpenNewSettings}"
|
||||
HorizontalAlignment="Left" Click="BtnOpenNewNewSettings_Click"
|
||||
Padding="15,5" Margin="0,10,0,0"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ui:ScrollViewerEx>
|
||||
|
||||
<!-- 底部按钮区域 -->
|
||||
<Grid Grid.Row="2" VerticalAlignment="Bottom" Height="65">
|
||||
<Button
|
||||
Width="120" Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
Click="BtnCloseSettings_Click">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<Image RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Margin="0,0,6,0" Height="20" Width="20">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="M19,6.41 L17.59,5 L12,10.59 L6.41,5 L5,6.41 L10.59,12 L5,17.59 L6.41,19 L12,13.41 L17.59,19 L19,17.59 L13.41,12 Z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Label FontSize="16" Foreground="#fafafa" VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Content="{i18n:I18n Key=Common_Close}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid></Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
<!--// 黑/白 板幕布 //-->
|
||||
<Grid Name="GridBackgroundCoverHolder">
|
||||
<Grid Name="GridBackgroundCover" Visibility="Collapsed" Background="#1F1F1F">
|
||||
|
||||
@@ -123,10 +123,8 @@ namespace Ink_Canvas
|
||||
BlackboardCenterSide.Visibility = Visibility.Collapsed;
|
||||
BlackboardRightSide.Visibility = Visibility.Collapsed;
|
||||
BorderTools.Visibility = Visibility.Collapsed;
|
||||
BorderSettings.Visibility = Visibility.Collapsed;
|
||||
LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
BorderSettings.Margin = new Thickness(0, 0, 0, 0);
|
||||
TwoFingerGestureBorder.Visibility = Visibility.Collapsed;
|
||||
BoardTwoFingerGestureBorder.Visibility = Visibility.Collapsed;
|
||||
BorderDrawShape.Visibility = Visibility.Collapsed;
|
||||
@@ -1266,12 +1264,6 @@ namespace Ink_Canvas
|
||||
// 设置窗口模式
|
||||
SetWindowMode();
|
||||
|
||||
// 注册设置面板滚动事件
|
||||
if (SettingsPanelScrollViewer != null)
|
||||
{
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
|
||||
// 初始化PPT管理器
|
||||
InitializePPTManagers();
|
||||
|
||||
@@ -2278,457 +2270,6 @@ namespace Ink_Canvas
|
||||
|
||||
#endregion Definations and Loading
|
||||
|
||||
#region Navigation Sidebar Methods
|
||||
|
||||
// 侧边栏导航按钮事件处理
|
||||
private void NavStartup_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到启动设置页面
|
||||
ShowSettingsSection("startup");
|
||||
}
|
||||
|
||||
private void NavCanvas_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到画布设置页面
|
||||
ShowSettingsSection("canvas");
|
||||
}
|
||||
|
||||
private void NavGesture_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到手势设置页面
|
||||
ShowSettingsSection("gesture");
|
||||
}
|
||||
|
||||
private void NavInkRecognition_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到墨迹识别设置页面
|
||||
ShowSettingsSection("inkrecognition");
|
||||
}
|
||||
|
||||
private void NavCrashAction_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到崩溃处理设置页面
|
||||
ShowSettingsSection("crashaction");
|
||||
}
|
||||
|
||||
private void NavPPT_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到PPT设置页面
|
||||
ShowSettingsSection("ppt");
|
||||
}
|
||||
|
||||
private void NavAdvanced_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到高级设置页面
|
||||
ShowSettingsSection("advanced");
|
||||
}
|
||||
|
||||
private void NavAutomation_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到自动化设置页面
|
||||
ShowSettingsSection("automation");
|
||||
}
|
||||
|
||||
private void NavRandomWindow_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到随机窗口设置页面
|
||||
ShowSettingsSection("randomwindow");
|
||||
}
|
||||
|
||||
private void NavAbout_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowSettingsSection("about");
|
||||
}
|
||||
|
||||
// 个性化设置
|
||||
private void NavTheme_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到个性化设置页面
|
||||
ShowSettingsSection("theme");
|
||||
}
|
||||
|
||||
// 快捷键设置
|
||||
private void NavShortcuts_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenHotkeySettingsWindow();
|
||||
}
|
||||
|
||||
private void BtnCloseSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 关闭设置面板
|
||||
BorderSettings.Visibility = Visibility.Collapsed;
|
||||
// 设置蒙版为不可点击,并清除背景
|
||||
BorderSettingsMask.IsHitTestVisible = false;
|
||||
BorderSettingsMask.Background = null; // 确保清除蒙层背景
|
||||
}
|
||||
|
||||
// 折叠侧边栏
|
||||
private void CollapseNavSidebar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 折叠/展开侧边栏
|
||||
var columnDefinitions = ((Grid)BorderSettings.Child).ColumnDefinitions;
|
||||
if (columnDefinitions[0].Width.Value == 50)
|
||||
{
|
||||
// 折叠侧边栏
|
||||
columnDefinitions[0].Width = new GridLength(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 展开侧边栏
|
||||
columnDefinitions[0].Width = new GridLength(50);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示侧边栏
|
||||
private void ShowNavSidebar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 确保侧边栏展开
|
||||
var columnDefinitions = ((Grid)BorderSettings.Child).ColumnDefinitions;
|
||||
columnDefinitions[0].Width = new GridLength(50);
|
||||
}
|
||||
|
||||
// 显示指定的设置部分
|
||||
private async void ShowSettingsSection(string sectionTag)
|
||||
{
|
||||
// 显示设置面板
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
// 设置蒙版为可点击,并添加半透明背景
|
||||
BorderSettingsMask.IsHitTestVisible = true;
|
||||
BorderSettingsMask.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
|
||||
// 获取SettingsPanelScrollViewer中的所有GroupBox
|
||||
var stackPanel = SettingsPanelScrollViewer.Content as StackPanel;
|
||||
if (stackPanel == null) return;
|
||||
|
||||
// 确保所有GroupBox都是可见的
|
||||
foreach (var child in stackPanel.Children)
|
||||
{
|
||||
if (child is GroupBox groupBox)
|
||||
{
|
||||
groupBox.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
// 确保UI完全更新
|
||||
await Dispatcher.InvokeAsync(() => { }, DispatcherPriority.Render);
|
||||
|
||||
// 根据传入的sectionTag滚动到相应的设置部分
|
||||
GroupBox targetGroupBox = null;
|
||||
|
||||
switch (sectionTag.ToLower())
|
||||
{
|
||||
case "startup":
|
||||
case "crashaction":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("StartupPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "gesture":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("CanvasPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "ppt":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("PowerPointPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "advanced":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("AdvancedPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "automation":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("AutomationPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "randomwindow":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("RandomDrawPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "theme":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("AppearancePage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "shortcuts":
|
||||
// 快捷键设置部分可能尚未实现
|
||||
targetGroupBox = null;
|
||||
break;
|
||||
default:
|
||||
// 默认滚动到顶部
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果找到目标GroupBox,则滚动到它的位置
|
||||
if (targetGroupBox != null)
|
||||
{
|
||||
// 使用动画平滑滚动到目标位置
|
||||
ScrollToElement(targetGroupBox);
|
||||
|
||||
// 高亮显示当前选中的导航项
|
||||
UpdateNavigationButtonState(sectionTag);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没有找到目标GroupBox,则滚动到顶部
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
}
|
||||
}
|
||||
|
||||
// 根据Header文本查找GroupBox
|
||||
private GroupBox FindGroupBoxByHeader(StackPanel parent, string headerText)
|
||||
{
|
||||
foreach (var child in parent.Children)
|
||||
{
|
||||
if (child is GroupBox groupBox)
|
||||
{
|
||||
// 查找GroupBox的Header
|
||||
if (groupBox.Header is TextBlock headerTextBlock &&
|
||||
headerTextBlock.Text != null &&
|
||||
headerTextBlock.Text.Contains(headerText))
|
||||
{
|
||||
return groupBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 平滑滚动到指定元素
|
||||
private async void ScrollToElement(FrameworkElement element)
|
||||
{
|
||||
if (element == null || SettingsPanelScrollViewer == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
// 暂时禁用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged -= SettingsPanelScrollViewer_ScrollChanged;
|
||||
|
||||
// 记录当前滚动位置
|
||||
double originalOffset = SettingsPanelScrollViewer.VerticalOffset;
|
||||
|
||||
// 将ScrollViewer内部的位置信息重置到顶部(不会触发视觉更新)
|
||||
SettingsPanelScrollViewer.ScrollToHome();
|
||||
|
||||
// 使用Dispatcher进行延迟处理,确保布局更新
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 强制更新布局
|
||||
SettingsPanelScrollViewer.UpdateLayout();
|
||||
|
||||
// 获取元素相对于顶部的准确位置
|
||||
Point elementPosition = element.TransformToAncestor(SettingsPanelScrollViewer).Transform(new Point(0, 0));
|
||||
|
||||
// 计算目标位置,减去一些偏移,使元素不会贴在顶部
|
||||
double targetPosition = elementPosition.Y - 20;
|
||||
|
||||
// 确保目标位置不小于0
|
||||
targetPosition = Math.Max(0, targetPosition);
|
||||
|
||||
// 直接设置滚动位置,不使用动画
|
||||
SettingsPanelScrollViewer.ScrollToVerticalOffset(targetPosition);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 如果出现异常,恢复到原来的滚动位置
|
||||
SettingsPanelScrollViewer.ScrollToVerticalOffset(originalOffset);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// 重新启用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
}, DispatcherPriority.Render);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// 确保在异常情况下也重新启用滚动事件处理
|
||||
SettingsPanelScrollViewer.ScrollChanged += SettingsPanelScrollViewer_ScrollChanged;
|
||||
}
|
||||
}
|
||||
|
||||
// 滚动条变化事件处理
|
||||
private void SettingsPanelScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
// 可以在这里添加滚动事件的处理逻辑,如果需要的话
|
||||
}
|
||||
|
||||
// 更新导航按钮状态
|
||||
private void UpdateNavigationButtonState(string activeTag)
|
||||
{
|
||||
// 清除所有导航按钮的Tag属性
|
||||
ClearAllNavButtonTags();
|
||||
|
||||
// 设置当前活动按钮的Tag属性
|
||||
switch (activeTag.ToLower())
|
||||
{
|
||||
case "startup":
|
||||
SetNavButtonTag("startup");
|
||||
break;
|
||||
case "canvas":
|
||||
SetNavButtonTag("canvas");
|
||||
break;
|
||||
case "gesture":
|
||||
SetNavButtonTag("gesture");
|
||||
break;
|
||||
case "inkrecognition":
|
||||
SetNavButtonTag("inkrecognition");
|
||||
break;
|
||||
case "crashaction":
|
||||
SetNavButtonTag("crashaction");
|
||||
break;
|
||||
case "ppt":
|
||||
SetNavButtonTag("ppt");
|
||||
break;
|
||||
case "advanced":
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("AdvancedPage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "automation":
|
||||
SetNavButtonTag("automation");
|
||||
break;
|
||||
case "randomwindow":
|
||||
SetNavButtonTag("randomwindow");
|
||||
break;
|
||||
case "theme":
|
||||
SetNavButtonTag("theme");
|
||||
break;
|
||||
case "shortcuts":
|
||||
SetNavButtonTag("shortcuts");
|
||||
break;
|
||||
case "about":
|
||||
SetNavButtonTag("about");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 清除所有导航按钮的Tag属性
|
||||
private void ClearAllNavButtonTags()
|
||||
{
|
||||
var grid = BorderSettings.Child as Grid;
|
||||
if (grid == null) return;
|
||||
|
||||
var navSidebar = grid.Children[0] as Border;
|
||||
if (navSidebar == null) return;
|
||||
|
||||
var navGrid = navSidebar.Child as Grid;
|
||||
if (navGrid == null) return;
|
||||
|
||||
var scrollViewer = navGrid.Children[1] as ScrollViewer;
|
||||
if (scrollViewer == null) return;
|
||||
|
||||
var stackPanel = scrollViewer.Content as StackPanel;
|
||||
if (stackPanel == null) return;
|
||||
|
||||
foreach (var child in stackPanel.Children)
|
||||
{
|
||||
if (child is Button button)
|
||||
{
|
||||
button.Tag = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置导航按钮的Tag属性
|
||||
private void SetNavButtonTag(string tag)
|
||||
{
|
||||
var grid = BorderSettings.Child as Grid;
|
||||
if (grid == null) return;
|
||||
|
||||
var navSidebar = grid.Children[0] as Border;
|
||||
if (navSidebar == null) return;
|
||||
|
||||
var navGrid = navSidebar.Child as Grid;
|
||||
if (navGrid == null) return;
|
||||
|
||||
var scrollViewer = navGrid.Children[1] as ScrollViewer;
|
||||
if (scrollViewer == null) return;
|
||||
|
||||
var stackPanel = scrollViewer.Content as StackPanel;
|
||||
if (stackPanel == null) return;
|
||||
|
||||
foreach (var child in stackPanel.Children)
|
||||
{
|
||||
if (child is Button button)
|
||||
{
|
||||
// 检查按钮的ToolTip属性,根据tag设置对应的按钮
|
||||
string buttonTag = button.Tag as string;
|
||||
|
||||
// 如果按钮的Tag与要设置的tag匹配,则设置Tag
|
||||
if (buttonTag != null && buttonTag.ToLower() == tag.ToLower())
|
||||
{
|
||||
button.Tag = tag;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据Header文本查找并显示GroupBox
|
||||
private void ShowGroupBoxByHeader(StackPanel parent, string headerText)
|
||||
{
|
||||
foreach (var child in parent.Children)
|
||||
{
|
||||
if (child is GroupBox groupBox)
|
||||
{
|
||||
// 查找GroupBox的Header
|
||||
if (groupBox.Header is TextBlock headerTextBlock &&
|
||||
headerTextBlock.Text != null &&
|
||||
headerTextBlock.Text.Contains(headerText))
|
||||
{
|
||||
groupBox.Visibility = Visibility.Visible;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Navigation Sidebar Methods
|
||||
|
||||
#region 新设置窗口
|
||||
private async void BtnOpenNewNewSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (isOpeningOrHidingSettingsPane) return;
|
||||
HideSubPanels();
|
||||
{
|
||||
var settingsWindow = new Windows.SettingsViews.SettingsWindow();
|
||||
settingsWindow.Owner = this;
|
||||
settingsWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 新设置窗口
|
||||
|
||||
// 在MainWindow类中添加:
|
||||
private void ApplyCurrentEraserShape()
|
||||
@@ -2798,15 +2339,9 @@ namespace Ink_Canvas
|
||||
|
||||
private void HistoryRollbackButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 收起设置面板(与插件面板一致)
|
||||
BorderSettings.Visibility = Visibility.Hidden;
|
||||
BorderSettingsMask.Visibility = Visibility.Hidden;
|
||||
var win = new HistoryRollbackWindow(Settings.Startup.UpdateChannel);
|
||||
win.Owner = this;
|
||||
win.ShowDialog();
|
||||
// 可选:回滚窗口关闭后恢复设置面板显示
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
BorderSettingsMask.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@@ -3009,31 +2544,12 @@ namespace Ink_Canvas
|
||||
return;
|
||||
}
|
||||
|
||||
// 暂时隐藏设置面板
|
||||
BorderSettings.Visibility = Visibility.Hidden;
|
||||
BorderSettingsMask.Visibility = Visibility.Hidden;
|
||||
|
||||
// 创建快捷键设置窗口
|
||||
var hotkeySettingsWindow = new HotkeySettingsWindow(this, _globalHotkeyManager);
|
||||
hotkeySettingsWindow.Owner = this;
|
||||
|
||||
// 设置窗口关闭事件,用于在快捷键设置窗口关闭后恢复设置面板
|
||||
hotkeySettingsWindow.Closed += (s, e) =>
|
||||
{
|
||||
// 恢复设置面板显示
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
BorderSettingsMask.Visibility = Visibility.Visible;
|
||||
};
|
||||
|
||||
// 显示快捷键设置窗口
|
||||
hotkeySettingsWindow.ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 确保在发生错误时也恢复设置面板显示
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
BorderSettingsMask.Visibility = Visibility.Visible;
|
||||
|
||||
LogHelper.WriteLogToFile($"打开快捷键设置窗口时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show($"打开快捷键设置窗口时出错: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
@@ -386,6 +386,10 @@ namespace Ink_Canvas
|
||||
{
|
||||
operatingGuideWindow.RefreshTheme();
|
||||
}
|
||||
else if (window is Windows.SettingsViews.SettingsWindow settingsWindow)
|
||||
{
|
||||
settingsWindow.RefreshTheme();
|
||||
}
|
||||
}
|
||||
|
||||
TimerControl?.RefreshTheme();
|
||||
|
||||
@@ -297,7 +297,6 @@ namespace Ink_Canvas
|
||||
BoardPenPalette.Visibility = Visibility.Collapsed;
|
||||
BoardEraserSizePanel.Visibility = Visibility.Collapsed;
|
||||
EraserSizePanel.Visibility = Visibility.Collapsed;
|
||||
BorderSettings.Visibility = Visibility.Collapsed;
|
||||
BoardBorderLeftPageListView.Visibility = Visibility.Collapsed;
|
||||
BoardBorderRightPageListView.Visibility = Visibility.Collapsed;
|
||||
BoardImageOptionsPanel.Visibility = Visibility.Collapsed;
|
||||
@@ -393,43 +392,6 @@ namespace Ink_Canvas
|
||||
AnimationsHelper.HideWithSlideAndFade(bgPalette);
|
||||
}
|
||||
|
||||
if (BorderSettings.Visibility == Visibility.Visible)
|
||||
{
|
||||
// 设置蒙版为不可点击,并移除背景
|
||||
BorderSettingsMask.IsHitTestVisible = false;
|
||||
BorderSettingsMask.Background = null;
|
||||
var sb = new Storyboard();
|
||||
|
||||
// 滑动动画
|
||||
var slideAnimation = new DoubleAnimation
|
||||
{
|
||||
From = 0, // 滑动距离
|
||||
To = BorderSettings.RenderTransform.Value.OffsetX - 490,
|
||||
Duration = TimeSpan.FromSeconds(0.6),
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
Storyboard.SetTargetProperty(slideAnimation,
|
||||
new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)"));
|
||||
|
||||
sb.Children.Add(slideAnimation);
|
||||
|
||||
sb.Completed += (s, _) =>
|
||||
{
|
||||
BorderSettings.Visibility = Visibility.Collapsed;
|
||||
isOpeningOrHidingSettingsPane = false;
|
||||
if (WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode)
|
||||
{
|
||||
WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode = false;
|
||||
ApplyNoFocusMode();
|
||||
}
|
||||
};
|
||||
|
||||
BorderSettings.RenderTransform = new TranslateTransform();
|
||||
|
||||
isOpeningOrHidingSettingsPane = true;
|
||||
sb.Begin(BorderSettings);
|
||||
}
|
||||
|
||||
AnimationsHelper.HideWithSlideAndFade(TwoFingerGestureBorder);
|
||||
AnimationsHelper.HideWithSlideAndFade(EraserSizePanel);
|
||||
AnimationsHelper.HideWithSlideAndFade(BoardTwoFingerGestureBorder);
|
||||
@@ -1101,10 +1063,8 @@ namespace Ink_Canvas
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void SymbolIconSettings_Click(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (isOpeningOrHidingSettingsPane) return;
|
||||
HideSubPanels();
|
||||
BtnSettings_Click(null, null);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 截图图标点击事件处理
|
||||
@@ -3078,17 +3038,6 @@ namespace Ink_Canvas
|
||||
LogHelper.WriteLogToFile($"停止PPT监控时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
|
||||
// 如果当前在设置面板中,需要先恢复无焦点模式状态
|
||||
if (BorderSettings.Visibility == Visibility.Visible)
|
||||
{
|
||||
if (WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode)
|
||||
{
|
||||
WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode = false;
|
||||
ApplyNoFocusMode();
|
||||
}
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
App.IsAppExitByUser = true;
|
||||
// 不设置 CloseIsFromButton = true,让它也经过确认流程
|
||||
Close();
|
||||
@@ -3101,53 +3050,12 @@ namespace Ink_Canvas
|
||||
/// <param name="e">路由事件参数</param>
|
||||
public void BtnRestart_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (BorderSettings.Visibility == Visibility.Visible)
|
||||
{
|
||||
if (WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode)
|
||||
{
|
||||
WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode = false;
|
||||
ApplyNoFocusMode();
|
||||
}
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m");
|
||||
App.IsAppExitByUser = true;
|
||||
// 不设置 CloseIsFromButton = true,让它也经过确认流程
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置覆盖层点击事件处理,用于点击设置面板外部时关闭设置面板
|
||||
/// </summary>
|
||||
/// <param name="sender">发送者</param>
|
||||
/// <param name="e">鼠标按钮事件参数</param>
|
||||
private void SettingsOverlayClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (isOpeningOrHidingSettingsPane) return;
|
||||
|
||||
// 获取点击的位置
|
||||
Point clickPoint = e.GetPosition(BorderSettingsMask);
|
||||
|
||||
// 获取BorderSettings的位置和大小
|
||||
Point settingsPosition = BorderSettings.TranslatePoint(new Point(0, 0), BorderSettingsMask);
|
||||
Rect settingsRect = new Rect(
|
||||
settingsPosition.X,
|
||||
settingsPosition.Y,
|
||||
BorderSettings.ActualWidth,
|
||||
BorderSettings.ActualHeight
|
||||
);
|
||||
|
||||
// 如果点击位置不在设置界面内部,才关闭设置界面
|
||||
if (!settingsRect.Contains(clickPoint))
|
||||
{
|
||||
BtnSettings_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private bool isOpeningOrHidingSettingsPane;
|
||||
private bool wasNoFocusModeBeforeSettings;
|
||||
|
||||
/// <summary>
|
||||
/// 切换并打开设置面板;在需要时先进行安全密码校验,然后显示设置面板并启动打开动画,同时根据设置暂时调整无焦点模式与遮罩交互状态。
|
||||
/// </summary>
|
||||
@@ -3155,60 +3063,25 @@ namespace Ink_Canvas
|
||||
/// <param name="e">路由事件参数</param>
|
||||
internal async void BtnSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (BorderSettings.Visibility == Visibility.Visible)
|
||||
try
|
||||
{
|
||||
HideSubPanels();
|
||||
if (Ink_Canvas.Helpers.SecurityManager.IsPasswordRequiredForEnterSettings(Settings))
|
||||
{
|
||||
bool ok = await Ink_Canvas.Helpers.SecurityManager.PromptAndVerifyAsync(Settings, this, "进入设置", "请输入安全密码以进入设置。");
|
||||
if (!ok) return;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Ink_Canvas.Helpers.SecurityManager.IsPasswordRequiredForEnterSettings(Settings))
|
||||
{
|
||||
bool ok = await Ink_Canvas.Helpers.SecurityManager.PromptAndVerifyAsync(Settings, this, "进入设置", "请输入安全密码以进入设置。");
|
||||
if (!ok) return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"安全密码校验失败: {ex}", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
BorderSettings.Visibility = Visibility.Visible;
|
||||
wasNoFocusModeBeforeSettings = Settings.Advanced.IsNoFocusMode;
|
||||
if (wasNoFocusModeBeforeSettings)
|
||||
{
|
||||
WindowSettingsHelper.IsTemporarilyDisablingNoFocusMode = true;
|
||||
ApplyNoFocusMode();
|
||||
}
|
||||
|
||||
// 设置蒙版为可点击,并添加半透明背景
|
||||
BorderSettingsMask.IsHitTestVisible = true;
|
||||
BorderSettingsMask.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
var sb = new Storyboard();
|
||||
|
||||
// 滑动动画
|
||||
var slideAnimation = new DoubleAnimation
|
||||
{
|
||||
From = BorderSettings.RenderTransform.Value.OffsetX - 490, // 滑动距离
|
||||
To = 0,
|
||||
Duration = TimeSpan.FromSeconds(0.6),
|
||||
EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
Storyboard.SetTargetProperty(slideAnimation,
|
||||
new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)"));
|
||||
|
||||
sb.Children.Add(slideAnimation);
|
||||
|
||||
sb.Completed += (s, _) => { isOpeningOrHidingSettingsPane = false; };
|
||||
|
||||
BorderSettings.RenderTransform = new TranslateTransform();
|
||||
|
||||
isOpeningOrHidingSettingsPane = true;
|
||||
sb.Begin(BorderSettings);
|
||||
LogHelper.WriteLogToFile($"安全密码校验失败: {ex}", LogHelper.LogType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
HideSubPanels();
|
||||
var settingsWindow = new Windows.SettingsViews.SettingsWindow();
|
||||
settingsWindow.Owner = this;
|
||||
settingsWindow.Topmost = this.Topmost;
|
||||
settingsWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void BtnThickness_Click(object sender, RoutedEventArgs e) { }
|
||||
|
||||
@@ -123,20 +123,6 @@ namespace Ink_Canvas
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsLegacySettingsVisible(MainWindow mainWin)
|
||||
{
|
||||
try
|
||||
{
|
||||
var borderSettingsField = typeof(MainWindow).GetField("BorderSettings", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
var borderSettings = borderSettingsField?.GetValue(mainWin) as FrameworkElement;
|
||||
return borderSettings?.Visibility == Visibility.Visible;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void TempShowMainWindowTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var mainWin = Current.MainWindow as MainWindow;
|
||||
@@ -224,11 +210,6 @@ namespace Ink_Canvas
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsLegacySettingsVisible(mainWin))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var method = typeof(MainWindow).GetMethod("BtnSettings_Click", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
@@ -1435,7 +1435,7 @@
|
||||
<value>Ignore EN5 desktop annotation window when auto folding</value>
|
||||
</data>
|
||||
<data name="AutoFold_OldZyBoard" xml:space="preserve">
|
||||
<value>Auto fold when entering old ZhongYuan whiteboard</value>
|
||||
<value>old ZhongYuan whiteboard</value>
|
||||
</data>
|
||||
<data name="Automation_AutoFoldInPPT" xml:space="preserve">
|
||||
<value>Auto fold while playing PPT</value>
|
||||
|
||||
@@ -1484,7 +1484,7 @@
|
||||
<value>自动收纳忽略桌面EN5批注窗口</value>
|
||||
</data>
|
||||
<data name="AutoFold_OldZyBoard" xml:space="preserve">
|
||||
<value>进入“中原旧白板”时自动收纳</value>
|
||||
<value>中原旧白板</value>
|
||||
</data>
|
||||
<data name="Automation_AutoFoldInPPT" xml:space="preserve">
|
||||
<value>播放PPT时自动收纳</value>
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace Ink_Canvas
|
||||
public partial class PrivacyAgreementWindow : Window
|
||||
{
|
||||
public bool UserAccepted { get; private set; } = false;
|
||||
private bool wasSettingsPanelVisible = false;
|
||||
|
||||
public PrivacyAgreementWindow()
|
||||
{
|
||||
@@ -23,40 +22,6 @@ namespace Ink_Canvas
|
||||
this.Topmost = true;
|
||||
AnimationsHelper.ShowWithSlideFromBottomAndFade(this, 0.25);
|
||||
ApplyTheme();
|
||||
HideSettingsPanel();
|
||||
}
|
||||
|
||||
private void HideSettingsPanel()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Application.Current.MainWindow is MainWindow mainWindow)
|
||||
{
|
||||
var borderSettings = mainWindow.FindName("BorderSettings") as Border;
|
||||
var borderSettingsMask = mainWindow.FindName("BorderSettingsMask") as Border;
|
||||
|
||||
if (borderSettings != null)
|
||||
{
|
||||
wasSettingsPanelVisible = borderSettings.Visibility == Visibility.Visible;
|
||||
if (wasSettingsPanelVisible)
|
||||
{
|
||||
borderSettings.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
|
||||
if (borderSettingsMask != null)
|
||||
{
|
||||
if (wasSettingsPanelVisible)
|
||||
{
|
||||
borderSettingsMask.Visibility = Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"隐藏设置面板失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
@@ -114,31 +79,6 @@ namespace Ink_Canvas
|
||||
|
||||
private void Window_Closing(object sender, CancelEventArgs e)
|
||||
{
|
||||
if (wasSettingsPanelVisible)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Application.Current.MainWindow is MainWindow mainWindow)
|
||||
{
|
||||
var borderSettings = mainWindow.FindName("BorderSettings") as Border;
|
||||
var borderSettingsMask = mainWindow.FindName("BorderSettingsMask") as Border;
|
||||
|
||||
if (borderSettings != null)
|
||||
{
|
||||
borderSettings.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
if (borderSettingsMask != null)
|
||||
{
|
||||
borderSettingsMask.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"恢复设置面板失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</Style>
|
||||
</FrameworkElement.Resources>
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel MaxWidth="1600"
|
||||
<ikw:SimpleStackPanel MaxWidth="1000"
|
||||
HorizontalAlignment="Stretch"
|
||||
Spacing="{StaticResource SettingsCardSpacing}">
|
||||
|
||||
@@ -214,21 +214,33 @@
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander Header="幻灯片"
|
||||
d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Automation_AutoFoldInPPT}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:ImageIcon Source="/Resources/Icons-png/PPTTools.png"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="CardAutoFoldInPPTSlideShow"
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Automation_AutoFoldInPPT}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:ImageIcon Source="/Resources/Icons-png/Powerpoint.png"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="CardAutoFoldInPPTSlideShow"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchAutoFoldInPPTSlideShow_Toggled"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoFoldWhenExitWhiteboard"
|
||||
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboard}"
|
||||
Description="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboardHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Back}"
|
||||
Toggled="ToggleSwitchAutoFoldWhenExitWhiteboard_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoFoldAfterPPTSlideShow"
|
||||
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterPPT}"
|
||||
Description="{i18n:I18n Key=FoldMode_AutoFoldAfterPPTHint}"
|
||||
IconSource="/Resources/Icons-png/PPTTools.png"
|
||||
Toggled="ToggleSwitchAutoFoldAfterPPTSlideShow_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardKeepFoldAfterSoftwareExit"
|
||||
Header="{i18n:I18n Key=Automation_KeepFoldAfterExit}"
|
||||
Description="{i18n:I18n Key=Automation_KeepFoldAfterExitHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Pin}"
|
||||
Toggled="ToggleSwitchKeepFoldAfterSoftwareExit_Toggled"/>
|
||||
|
||||
<TextBlock Text="{i18n:I18n Key=AutoKill_Title}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
|
||||
|
||||
@@ -250,7 +262,7 @@
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoKillVComYouJiao"
|
||||
Header="{i18n:I18n Key=AutoKill_YouJiao}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
|
||||
IconSource="/Resources/Icons-png/VComYouJiao.png"
|
||||
Toggled="ToggleSwitchAutoKillVComYouJiao_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoKillSeewoLauncher2DesktopAnnotation"
|
||||
@@ -261,48 +273,32 @@
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoKillInkCanvas"
|
||||
Header="{i18n:I18n Key=AutoKill_InkCanvasIC}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
|
||||
IconSource="/Resources/Icons-png/InkCanvas.png"
|
||||
Toggled="ToggleSwitchAutoKillInkCanvas_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoKillICA"
|
||||
Header="{i18n:I18n Key=AutoKill_ICA}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
|
||||
IconSource="/Resources/Icons-png/ICA.png"
|
||||
Toggled="ToggleSwitchAutoKillICA_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoKillIDT"
|
||||
Header="{i18n:I18n Key=AutoKill_Inkeys}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
|
||||
IconSource="/Resources/Icons-png/idt.png"
|
||||
Toggled="ToggleSwitchAutoKillIDT_Toggled"/>
|
||||
|
||||
<TextBlock Text="{i18n:I18n Key=AutoFold_Mode}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationModeWhenExitFoldMode"
|
||||
Header="{i18n:I18n Key=FoldMode_ExitToAnnotation}"
|
||||
Description="{i18n:I18n Key=FoldMode_ExitToAnnotationHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Edit}"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationAfterKillHite"
|
||||
Header="{i18n:I18n Key=AutoKill_HiteAfterKillEnterAnnotation}"
|
||||
IconSource="/Resources/Icons-png/HiteAnnotation.png"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationAfterKillHite_Toggled"/>
|
||||
|
||||
<TextBlock Text="{i18n:I18n Key=AutoFold_Mode}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationModeWhenExitFoldMode"
|
||||
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboard}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Edit}"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoFoldWhenExitWhiteboard"
|
||||
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboard}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Back}"
|
||||
Toggled="ToggleSwitchAutoFoldWhenExitWhiteboard_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoFoldAfterPPTSlideShow"
|
||||
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterPPT}"
|
||||
Description="{i18n:I18n Key=FoldMode_AutoFoldAfterPPTHint}"
|
||||
IconSource="/Resources/Icons-png/PPTTools.png"
|
||||
Toggled="ToggleSwitchAutoFoldAfterPPTSlideShow_Toggled"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardKeepFoldAfterSoftwareExit"
|
||||
Header="{i18n:I18n Key=Automation_KeepFoldAfterExit}"
|
||||
Description="{i18n:I18n Key=Automation_KeepFoldAfterExitHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Pin}"
|
||||
Toggled="ToggleSwitchKeepFoldAfterSoftwareExit_Toggled"/>
|
||||
|
||||
<TextBlock Text="{i18n:I18n Key=AutoSave_Title}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardSaveScreenshotsInDateFolders"
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ApplyCurrentTheme();
|
||||
|
||||
// 初始化内置页面映射
|
||||
_pageTypes = new Dictionary<string, Type>
|
||||
{
|
||||
@@ -124,6 +126,27 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
};
|
||||
}
|
||||
|
||||
public void RefreshTheme()
|
||||
{
|
||||
ApplyCurrentTheme();
|
||||
}
|
||||
|
||||
private void ApplyCurrentTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
int themeIndex = Helpers.SettingsManager.Settings.Appearance.Theme;
|
||||
var elementTheme = themeIndex switch
|
||||
{
|
||||
0 => iNKORE.UI.WPF.Modern.ElementTheme.Light,
|
||||
1 => iNKORE.UI.WPF.Modern.ElementTheme.Dark,
|
||||
_ => iNKORE.UI.WPF.Modern.ElementTheme.Default,
|
||||
};
|
||||
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, elementTheme);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
#region 修复触摸屏鼠标指针消失问题
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||
|
||||
Reference in New Issue
Block a user