feat(设置): 新增个性化设置页面并重构主题相关功能
重构主题和语言设置功能,将相关代码从主窗口迁移至新增的个性化设置页面 优化浮动工具栏图标选择逻辑,移除冗余代码 统一设置页面中开关控件的样式和行为 修复设置页面导航项的选择状态问题
This commit is contained in:
+4
-358
@@ -640,360 +640,6 @@
|
||||
Padding="15,5" Margin="0,10,0,0"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="GroupBoxAppearanceNewUI">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Theme_GroupTitle}" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="6">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_Label}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxTheme"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxTheme_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Light}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Dark}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_System}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_LanguageLabel}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxLanguage"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxLanguage_SelectionChanged"
|
||||
Width="160">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_System}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_ChineseSimplified}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_English}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Theme_Language_RestartHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableSplashScreen" Label="{i18n:I18n Key=Theme_EnableSplash}" IsOn="False" Toggled="ToggleSwitchEnableSplashScreen_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_SplashStyle}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxSplashScreenStyle"
|
||||
SelectedIndex="1" Width="150"
|
||||
SelectionChanged="ComboBoxSplashScreenStyle_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Random}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Seasonal}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Spring}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Summer}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Autumn}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Winter}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Horse}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_FloatingBarIcon}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxFloatingBarImg"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDefault}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccNoShadow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDark}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDarkBreath}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccWhiteTransparent}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccBlackTransparent}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkCrossEye}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkAbused}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkSmile}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkUnderwear}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkGreenHatDoge}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_TiebaEmoji}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,6,0,0">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_CustomFloatingIconLabel}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Button Name="ButtonAddCustomIcon" Content="{i18n:I18n Key=Theme_Upload}"
|
||||
Click="ButtonAddCustomIcon_Click" Padding="10,3"/>
|
||||
<Button Name="ButtonManageCustomIcons" Content="{i18n:I18n Key=Theme_Manage}"
|
||||
Click="ButtonManageCustomIcons_Click" Padding="10,3" Margin="5,0,0,0"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_FloatingBarScale}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Minimum="0.5"
|
||||
Maximum="1.25" Width="168"
|
||||
FontSize="20" IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarScaleTransformValueSlider_ValueChanged" />
|
||||
<TextBlock
|
||||
Text="{Binding ElementName=ViewboxFloatingBarScaleTransformValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontSize="14" FontFamily="Consolas"
|
||||
Margin="12,0,16,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_FloatingBarOpacity}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider x:Name="ViewboxFloatingBarOpacityValueSlider" Minimum="0.3"
|
||||
Maximum="1" Width="168"
|
||||
FontSize="20" IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarOpacityValueSlider_ValueChanged" />
|
||||
<TextBlock
|
||||
Text="{Binding ElementName=ViewboxFloatingBarOpacityValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontSize="14" FontFamily="Consolas"
|
||||
Margin="12,0,16,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_FloatingBarOpacityInPPT}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider x:Name="ViewboxFloatingBarOpacityInPPTValueSlider" Minimum="0.3"
|
||||
Maximum="1" Width="168"
|
||||
FontSize="20" IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged" />
|
||||
<TextBlock
|
||||
Text="{Binding ElementName=ViewboxFloatingBarOpacityInPPTValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontSize="14" FontFamily="Consolas"
|
||||
Margin="12,0,16,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Theme_FloatingBarOpacityInPPTHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableDisPlayNibModeToggle" Label="{i18n:I18n Key=Theme_ShowNibButton}" IsOn="False" Toggled="ToggleSwitchEnableDisPlayNibModeToggle_Toggled"/>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<!--<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Text="浮动工具栏背景色" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchColorfulViewboxFloatingBar" IsOn="True" FontWeight="Bold" Toggled="ToggleSwitchIsColorfulViewboxFloatingBar_Toggled" />
|
||||
</ikw:SimpleStackPanel>-->
|
||||
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableViewboxBlackBoardScaleTransform" Label="{i18n:I18n Key=Theme_BlackboardScale80}" IsOn="True" Toggled="ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableTimeDisplayInWhiteboardMode" Label="{i18n:I18n Key=Theme_ShowTimeInWhiteboard}" IsOn="True" Toggled="ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableChickenSoupInWhiteboardMode" Label="{i18n:I18n Key=Theme_ShowQuoteInWhiteboard}" IsOn="True" Toggled="ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_QuoteSource}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,0,6" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<ComboBox Name="ComboBoxChickenSoupSource"
|
||||
Width="240"
|
||||
SelectionChanged="ComboBoxChickenSoupSource_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_OsuQuotes}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Mottos}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_GaokaoBless}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Hitokoto}" />
|
||||
</ComboBox>
|
||||
<Button Name="BtnHitokotoCustomize" Content="{i18n:I18n Key=Theme_Customize}"
|
||||
FontSize="14" Padding="14,4" Margin="8,0,0,0" MinWidth="65" VerticalAlignment="Center"
|
||||
Click="BtnHitokotoCustomize_Click"
|
||||
Visibility="Collapsed" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableQuickPanel" Label="{i18n:I18n Key=Theme_EnableQuickPanel}" IsOn="True" Toggled="ToggleSwitchEnableQuickPanel_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_UnfoldButtonIcon}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxUnFoldBtnImg"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxUnFoldBtnImg_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Arrow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Pen}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
|
||||
<!-- 浮动栏按钮显示控制 -->
|
||||
<Border Background="#101010" Height="50" Margin="-20,0" Padding="20,0">
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
|
||||
<Image Height="24" Width="24" Margin="16,0,0,0">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#FFFFFFFF"
|
||||
Geometry="F0 M24,24z M0,0z M4.41721,4.29873C4.35178,4.29873,4.29873,4.35178,4.29873,4.41721L4.29873,9.15646C4.29873,9.22189,4.35178,9.27494,4.41721,9.27494L9.15646,9.27494C9.22189,9.27494,9.27494,9.22189,9.27494,9.15646L9.27494,4.41721C9.27494,4.35178,9.22189,4.29873,9.15646,4.29873L4.41721,4.29873z M2.64,4.41721C2.64,3.43569,3.43569,2.64,4.41721,2.64L9.15646,2.64C10.138,2.64,10.9337,3.43569,10.9337,4.41721L10.9337,9.15646C10.9337,10.138,10.138,10.9337,9.15646,10.9337L4.41721,10.9337C3.43569,10.9337,2.64,10.138,2.64,9.15646L2.64,4.41721z M14.8435,4.29873C14.7781,4.29873,14.7251,4.35178,14.7251,4.41721L14.7251,9.15646C14.7251,9.22189,14.7781,9.27494,14.8435,9.27494L19.5828,9.27494C19.6482,9.27494,19.7013,9.22189,19.7013,9.15646L19.7013,4.41721C19.7013,4.35178,19.6482,4.29873,19.5828,4.29873L14.8435,4.29873z M13.0663,4.41721C13.0663,3.43569,13.862,2.64,14.8435,2.64L19.5828,2.64C20.5643,2.64,21.36,3.43569,21.36,4.41721L21.36,9.15646C21.36,10.138,20.5643,10.9337,19.5828,10.9337L14.8435,10.9337C13.862,10.9337,13.0663,10.138,13.0663,9.15646L13.0663,4.41721z M14.8435,14.7251C14.7781,14.7251,14.7251,14.7781,14.7251,14.8435L14.7251,19.5828C14.7251,19.6482,14.7781,19.7013,14.8435,19.7013L19.5828,19.7013C19.6482,19.7013,19.7013,19.6482,19.7013,19.5828L19.7013,14.8435C19.7013,14.7781,19.6482,14.7251,19.5828,14.7251L14.8435,14.7251z M13.0663,14.8435C13.0663,13.862,13.862,13.0663,14.8435,13.0663L19.5828,13.0663C20.5643,13.0663,21.36,13.862,21.36,14.8435L21.36,19.5828C21.36,20.5643,20.5643,21.36,19.5828,21.36L14.8435,21.36C13.862,21.36,13.0663,20.5643,13.0663,19.5828L13.0663,14.8435z M4.41721,14.7251C4.35178,14.7251,4.29873,14.7781,4.29873,14.8435L4.29873,19.5828C4.29873,19.6482,4.35178,19.7013,4.41721,19.7013L9.15646,19.7013C9.22189,19.7013,9.27494,19.6482,9.27494,19.5828L9.27494,14.8435C9.27494,14.7781,9.22189,14.7251,9.15646,14.7251L4.41721,14.7251z M2.64,14.8435C2.64,13.862,3.43569,13.0663,4.41721,13.0663L9.15646,13.0663C10.138,13.0663,10.9337,13.862,10.9337,14.8435L10.9337,19.5828C10.9337,20.5643,10.138,21.36,9.15646,21.36L4.41721,21.36C3.43569,21.36,2.64,20.5643,2.64,19.5828L2.64,14.8435z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Margin="12,0,0,0" VerticalAlignment="Center" Text="{i18n:I18n Key=Theme_FloatingBarButtonsTitle}"
|
||||
FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="20" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 老版UI切换按钮 -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,12">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_UseLegacyFloatingBarUI}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="320"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxUseLegacyFloatingBarUI"
|
||||
IsChecked="False" FontWeight="Bold"
|
||||
Checked="CheckBoxUseLegacyFloatingBarUI_Checked" Unchecked="CheckBoxUseLegacyFloatingBarUI_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 第一行:形状按钮和撤销按钮 -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,0,0,8">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowShapeButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowShapeButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowShapeButton_Checked" Unchecked="CheckBoxShowShapeButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowUndoButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowUndoButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowUndoButton_Checked" Unchecked="CheckBoxShowUndoButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 第二行:重做按钮和清空按钮 -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,0,0,8">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowRedoButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowRedoButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowRedoButton_Checked" Unchecked="CheckBoxShowRedoButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowClearButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowClearButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowClearButton_Checked" Unchecked="CheckBoxShowClearButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 第三行:白板按钮和隐藏按钮 -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,0,0,8">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowWhiteboardButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowWhiteboardButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowWhiteboardButton_Checked" Unchecked="CheckBoxShowWhiteboardButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowHideButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowHideButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowHideButton_Checked" Unchecked="CheckBoxShowHideButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 第四行:套索选择按钮和清并鼠按钮 -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,0,0,8">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowLassoButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowLassoSelectButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowLassoSelectButton_Checked" Unchecked="CheckBoxShowLassoSelectButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="190">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowClearAndMouseButton}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" Width="150"
|
||||
Style="{StaticResource AutoFitSettingsOptionLabel14}" />
|
||||
<CheckBox Name="CheckBoxShowClearAndMouseButton"
|
||||
IsChecked="True" FontWeight="Bold"
|
||||
Checked="CheckBoxShowClearAndMouseButton_Checked" Unchecked="CheckBoxShowClearAndMouseButton_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 第五行:快捷调色盘(单独一行,因为需要更多空间) -->
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_ShowQuickPalette}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,8,0" />
|
||||
<CheckBox Name="CheckBoxShowQuickColorPalette"
|
||||
IsChecked="False" FontWeight="Bold"
|
||||
Checked="CheckBoxShowQuickColorPalette_Checked" Unchecked="CheckBoxShowQuickColorPalette_Unchecked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_QuickPaletteMode}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxQuickColorPaletteDisplayMode"
|
||||
SelectedIndex="1"
|
||||
SelectionChanged="ComboBoxQuickColorPaletteDisplayMode_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_SingleRow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_DoubleRow}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Theme_EraserButtonDisplay}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxEraserDisplayOption"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxEraserDisplayOption_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_Both}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_AreaOnly}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_LineOnly}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_None}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
|
||||
<Border Background="#101010" Height="50" Margin="-20,0" Padding="20,0">
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
|
||||
<Image Height="24" Width="24" Margin="16,0,0,0">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V17 H19 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#FFFFFFFF"
|
||||
Geometry="F1 M19,17z M0,0z M14.8268,0.0699463C15.3572,0.600333 15.8257,1.17492 16.2323,1.7937 16.6448,2.41249 16.9925,3.06368 17.2754,3.74729 17.5583,4.42501 17.7704,5.12925 17.9119,5.86 18.0592,6.58486 18.1329,7.32151 18.1329,8.06995 18.1329,8.81838 18.0592,9.55798 17.9119,10.2887 17.7704,11.0136 17.5583,11.7178 17.2754,12.4014 16.9925,13.0792 16.6448,13.7274 16.2323,14.3462 15.8257,14.965 15.3572,15.5396 14.8268,16.0699L14.0312,15.2744C14.5086,14.797 14.9299,14.2814 15.2953,13.7274 15.6666,13.1676 15.9789,12.5812 16.2323,11.9683 16.4857,11.3554 16.6773,10.7219 16.8069,10.0677 16.9424,9.4077 17.0102,8.74177 17.0102,8.06995 17.0102,7.39812 16.9424,6.73514 16.8069,6.081 16.6773,5.42096 16.4857,4.7845 16.2323,4.1716 15.9789,3.55871 15.6666,2.97529 15.2953,2.42133 14.9299,1.86147 14.5086,1.34287 14.0312,0.865526L14.8268,0.0699463z M12.4312,2.46553C12.8025,2.8368 13.1296,3.24048 13.4124,3.67658 13.7012,4.10678 13.9428,4.56055 14.1373,5.0379 14.3377,5.51525 14.4879,6.01028 14.5881,6.52299 14.6942,7.03569 14.7472,7.55135 14.7472,8.06995 14.7472,8.59444 14.6942,9.11304 14.5881,9.62575 14.4879,10.1326 14.3377,10.6246 14.1373,11.102 13.9428,11.5793 13.7012,12.0361 13.4124,12.4722 13.1296,12.9024 12.8025,13.3031 12.4312,13.6744L11.6268,12.8699C12.2633,12.2335 12.7524,11.4998 13.0942,10.6688 13.4419,9.8379 13.6157,8.9716 13.6157,8.06995 13.6157,7.16829 13.4419,6.30199 13.0942,5.47105 12.7524,4.64011 12.2633,3.90641 11.6268,3.26995L12.4312,2.46553z M10.0268,4.86995C10.4511,5.29426 10.7782,5.78339 11.008,6.33735 11.2378,6.89131 11.3528,7.46884 11.3528,8.06995 11.3528,8.67105 11.2378,9.24858 11.008,9.80254 10.7782,10.3565 10.4511,10.8456 10.0268,11.2699L9.23121,10.4744C9.54944,10.1561 9.79401,9.79076 9.96491,9.37823 10.1358,8.95982 10.2213,8.52372 10.2213,8.06995 10.2213,7.61617 10.1358,7.18302 9.96491,6.7705 9.79401,6.35208 9.54944,5.98376 9.23121,5.66553L10.0268,4.86995z M6.02237,1.281L6.82679,1.281 6.82679,14.8589 6.02237,14.8589 2.6279,11.4644 0.0378418,11.4644 0.0378418,4.67547 2.6279,4.67547 6.02237,1.281z M5.6953,3.21691L3.10525,5.80696 1.16933,5.80696 1.16933,10.3329 3.10525,10.3329 5.6953,12.923 5.6953,3.21691z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Image Height="24" Width="24" Margin="8,0,0,0">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V17 H22 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#FFFFFFFF"
|
||||
Geometry="F1 M22,17z M0,0z M21.3712,12.8727L12.0378,12.8727 12.0378,15.5393 16.0378,15.5393 16.0378,16.8727 6.70451,16.8727 6.70451,15.5393 10.7045,15.5393 10.7045,12.8727 4.03784,12.8727 4.03784,16.8727 2.70451,16.8727 2.70451,8.87268 0.0378418,8.87268 0.0378418,0.872681 21.3712,0.872681 21.3712,12.8727z M1.37118,2.20601L1.37118,3.53935 5.37118,3.53935 5.37118,2.20601 1.37118,2.20601z M1.37118,7.53935L5.37118,7.53935 5.37118,4.87268 4.03784,4.87268 4.03784,6.20601 2.70451,6.20601 2.70451,4.87268 1.37118,4.87268 1.37118,7.53935z M4.03784,11.5393L20.0378,11.5393 20.0378,2.20601 6.70451,2.20601 6.70451,8.87268 4.03784,8.87268 4.03784,11.5393z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Image Name="ICCTrayIconExampleImage" Height="24" Width="24"
|
||||
Source="Resources/icc.ico" Margin="8,0,0,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Margin="12,0,0,0" VerticalAlignment="Center" Text="{i18n:I18n Key=Tray_GroupTitle}"
|
||||
FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="20" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableTrayIcon" Label="{i18n:I18n Key=Tray_EnableTrayIcon}" IsOn="True" Toggled="ToggleSwitchEnableTrayIcon_Toggled"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxPPT">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=PPT_GroupTitle}" FontWeight="Bold" Foreground="#fafafa"
|
||||
@@ -4093,11 +3739,11 @@
|
||||
FontSize="12"
|
||||
VerticalAlignment="Center" />
|
||||
<ui:ToggleSwitch
|
||||
x:Name="BoardToggleSwitchEnableInkToShape"
|
||||
Foreground="{DynamicResource FloatBarForeground}"
|
||||
Width="80"
|
||||
Toggled="ToggleSwitchEnableInkToShape_Toggled"
|
||||
MinWidth="0"
|
||||
IsOn="{Binding ElementName=ToggleSwitchEnableInkToShape, Path=IsOn}" />
|
||||
MinWidth="0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal"
|
||||
Width="100" x:Name="InkFadeControlPanel1">
|
||||
@@ -5614,11 +5260,11 @@
|
||||
Foreground="{DynamicResource FloatBarForeground}"
|
||||
FontSize="12" VerticalAlignment="Center" />
|
||||
<ui:ToggleSwitch
|
||||
x:Name="FloatingBarToggleSwitchEnableInkToShape"
|
||||
Foreground="{DynamicResource FloatBarForeground}"
|
||||
Width="80"
|
||||
Toggled="ToggleSwitchEnableInkToShape_Toggled"
|
||||
MinWidth="0"
|
||||
IsOn="{Binding ElementName=ToggleSwitchEnableInkToShape, Path=IsOn}" />
|
||||
MinWidth="0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal"
|
||||
Width="100" x:Name="InkFadeControlPanel2">
|
||||
|
||||
+36
-145
@@ -67,8 +67,8 @@ namespace Ink_Canvas
|
||||
private WindowOverviewModel _windowOverviewModel;
|
||||
|
||||
// 设置面板相关状态
|
||||
private bool _isApplyingLanguageFromSettings;
|
||||
private bool _isReloadingForLanguageChange;
|
||||
// _isApplyingLanguageFromSettings migrated to AppearancePage
|
||||
internal bool _isReloadingForLanguageChange;
|
||||
|
||||
// 全屏处理状态标志
|
||||
public bool isFullScreenApplied = false;
|
||||
@@ -1487,36 +1487,13 @@ namespace Ink_Canvas
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ComboBoxLanguage == null || Settings?.Appearance == null) return;
|
||||
if (Settings?.Appearance == null) return;
|
||||
|
||||
var preferredLanguage = Settings.Appearance.Language ?? string.Empty;
|
||||
int index;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(preferredLanguage))
|
||||
if (!string.IsNullOrWhiteSpace(preferredLanguage))
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
else if (string.Equals(preferredLanguage, "zh-CN", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
index = 1;
|
||||
}
|
||||
else if (string.Equals(preferredLanguage, "en-US", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
index = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
||||
_isApplyingLanguageFromSettings = true;
|
||||
try
|
||||
{
|
||||
ComboBoxLanguage.SelectedIndex = index;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isApplyingLanguageFromSettings = false;
|
||||
LocalizationHelper.TrySetCulture(preferredLanguage);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2411,7 +2388,21 @@ namespace Ink_Canvas
|
||||
{
|
||||
case "startup":
|
||||
case "crashaction":
|
||||
break;
|
||||
{
|
||||
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":
|
||||
targetGroupBox = GroupBoxPPT;
|
||||
break;
|
||||
@@ -2425,8 +2416,13 @@ namespace Ink_Canvas
|
||||
targetGroupBox = GroupBoxRandWindow;
|
||||
break;
|
||||
case "theme":
|
||||
targetGroupBox = GroupBoxAppearanceNewUI;
|
||||
break;
|
||||
{
|
||||
var sw = new Windows.SettingsViews.SettingsWindow();
|
||||
sw.Owner = this;
|
||||
sw.NavigateToPage("AppearancePage");
|
||||
sw.ShowDialog();
|
||||
return;
|
||||
}
|
||||
case "shortcuts":
|
||||
// 快捷键设置部分可能尚未实现
|
||||
targetGroupBox = null;
|
||||
@@ -3051,7 +3047,13 @@ namespace Ink_Canvas
|
||||
{
|
||||
var toggle = sender as ToggleSwitch;
|
||||
if (toggle == null) return;
|
||||
Settings.InkToShape.IsInkToShapeEnabled = toggle.IsOn;
|
||||
|
||||
if (sender == FloatingBarToggleSwitchEnableInkToShape)
|
||||
BoardToggleSwitchEnableInkToShape.IsOn = FloatingBarToggleSwitchEnableInkToShape.IsOn;
|
||||
else
|
||||
FloatingBarToggleSwitchEnableInkToShape.IsOn = BoardToggleSwitchEnableInkToShape.IsOn;
|
||||
|
||||
Settings.InkToShape.IsInkToShapeEnabled = FloatingBarToggleSwitchEnableInkToShape.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -3454,9 +3456,6 @@ namespace Ink_Canvas
|
||||
// 获取所有滑块控件并添加触摸支持
|
||||
var sliders = new List<Slider>
|
||||
{
|
||||
ViewboxFloatingBarScaleTransformValueSlider,
|
||||
ViewboxFloatingBarOpacityValueSlider,
|
||||
ViewboxFloatingBarOpacityInPPTValueSlider,
|
||||
PPTButtonLeftPositionValueSlider,
|
||||
PPTButtonRightPositionValueSlider,
|
||||
PPTButtonLBPositionValueSlider,
|
||||
@@ -3797,122 +3796,14 @@ namespace Ink_Canvas
|
||||
|
||||
#region Theme Toggle
|
||||
|
||||
/// <summary>
|
||||
/// 主题下拉框选择变化事件
|
||||
/// </summary>
|
||||
private void ComboBoxTheme_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
// ComboBoxTheme_SelectionChanged and ComboBoxLanguage_SelectionChanged migrated to AppearancePage
|
||||
|
||||
try
|
||||
{
|
||||
System.Windows.Controls.ComboBox comboBox = sender as System.Windows.Controls.ComboBox;
|
||||
if (comboBox != null)
|
||||
{
|
||||
Settings.Appearance.Theme = comboBox.SelectedIndex;
|
||||
|
||||
// 应用新主题
|
||||
ApplyTheme(comboBox.SelectedIndex);
|
||||
|
||||
// 保存设置
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 显示通知
|
||||
string themeName;
|
||||
switch (comboBox.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
themeName = "浅色主题";
|
||||
break;
|
||||
case 1:
|
||||
themeName = "深色主题";
|
||||
break;
|
||||
case 2:
|
||||
themeName = "跟随系统";
|
||||
break;
|
||||
default:
|
||||
themeName = "未知主题";
|
||||
break;
|
||||
}
|
||||
|
||||
ShowNotification($"已切换到{themeName}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换主题时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
ShowNotification("主题切换失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ComboBoxLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
if (_isApplyingLanguageFromSettings) return;
|
||||
if (_isReloadingForLanguageChange) return;
|
||||
if (Settings?.Appearance == null) return;
|
||||
if (ComboBoxLanguage == null) return;
|
||||
|
||||
var index = ComboBoxLanguage.SelectedIndex;
|
||||
string language;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 1:
|
||||
language = "zh-CN";
|
||||
break;
|
||||
case 2:
|
||||
language = "en-US";
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
language = string.Empty;
|
||||
break;
|
||||
}
|
||||
|
||||
Settings.Appearance.Language = language;
|
||||
SaveSettingsToFile();
|
||||
|
||||
LocalizationHelper.TrySetCulture(language);
|
||||
|
||||
_isReloadingForLanguageChange = true;
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var newWindow = new MainWindow
|
||||
{
|
||||
WindowState = WindowState,
|
||||
Left = Left,
|
||||
Top = Top
|
||||
};
|
||||
newWindow.Show();
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"重建主窗口以应用语言时出错: {ex2.Message}", LogHelper.LogType.Error);
|
||||
ShowNotification("已更新界面语言设置,重启应用后可完全生效。");
|
||||
_isReloadingForLanguageChange = false;
|
||||
}
|
||||
}), DispatcherPriority.ApplicationIdle);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换界面语言时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
ShowNotification("切换界面语言失败。");
|
||||
_isReloadingForLanguageChange = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用指定主题
|
||||
/// </summary>
|
||||
/// <param name="themeIndex">主题索引:0-浅色,1-深色,2-跟随系统</param>
|
||||
private void ApplyTheme(int themeIndex)
|
||||
internal void ApplyTheme(int themeIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -282,16 +282,6 @@ namespace Ink_Canvas
|
||||
|
||||
private void UpdateFloatingBarIconComboBox()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ComboBoxFloatingBarImg != null)
|
||||
{
|
||||
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshStrokeSelectionIcons()
|
||||
|
||||
@@ -3304,7 +3304,7 @@ namespace Ink_Canvas
|
||||
StackPanelControl.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private int currentMode;
|
||||
internal int currentMode;
|
||||
|
||||
// 退出批注模式时的全屏还原处理
|
||||
private void RestoreFullScreenOnExitAnnotationMode()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using H.NotifyIcon;
|
||||
using H.NotifyIcon;
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using Newtonsoft.Json;
|
||||
@@ -186,232 +186,9 @@ namespace Ink_Canvas
|
||||
|
||||
#region Appearance
|
||||
|
||||
/// <summary>
|
||||
/// 处理显示笔尖模式切换开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当显示笔尖模式切换开关状态更改时:
|
||||
/// 1. 保存显示笔尖模式切换设置
|
||||
/// 2. 根据设置显示或隐藏笔尖模式切换面板
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableDisPlayNibModeToggle_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsEnableDisPlayNibModeToggler = ToggleSwitchEnableDisPlayNibModeToggle.IsOn;
|
||||
SaveSettingsToFile();
|
||||
if (!ToggleSwitchEnableDisPlayNibModeToggle.IsOn)
|
||||
{
|
||||
NibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
|
||||
BoardNibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
NibModeSimpleStackPanel.Visibility = Visibility.Visible;
|
||||
BoardNibModeSimpleStackPanel.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
//private void ToggleSwitchIsColorfulViewboxFloatingBar_Toggled(object sender, RoutedEventArgs e) {
|
||||
// if (!isLoaded) return;
|
||||
// Settings.Appearance.IsColorfulViewboxFloatingBar = ToggleSwitchColorfulViewboxFloatingBar.IsOn;
|
||||
// SaveSettingsToFile();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 处理快速面板开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当快速面板开关状态更改时,保存设置到文件
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableQuickPanel_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowQuickPanel = ToggleSwitchEnableQuickPanel.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理启动屏幕开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当启动屏幕开关状态更改时,保存设置到文件
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableSplashScreen_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EnableSplashScreen = ToggleSwitchEnableSplashScreen.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理启动屏幕样式选择更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当选择启动屏幕样式时,保存设置到文件
|
||||
/// </remarks>
|
||||
private void ComboBoxSplashScreenStyle_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.SplashScreenStyle = ComboBoxSplashScreenStyle.SelectedIndex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理浮动栏缩放值滑块值更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当浮动栏缩放值滑块值更改时:
|
||||
/// 1. 保存浮动栏缩放设置
|
||||
/// 2. 应用缩放值到浮动栏(限制在0.5-1.25范围内)
|
||||
/// 3. 等待UI更新后重新计算浮动栏位置,确保居中计算准确
|
||||
/// 4. 只在屏幕模式下重新计算浮动栏位置
|
||||
/// </remarks>
|
||||
private void ViewboxFloatingBarScaleTransformValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.ViewboxFloatingBarScaleTransformValue =
|
||||
ViewboxFloatingBarScaleTransformValueSlider.Value;
|
||||
SaveSettingsToFile();
|
||||
var val = ViewboxFloatingBarScaleTransformValueSlider.Value;
|
||||
ViewboxFloatingBarScaleTransform.ScaleX =
|
||||
val > 0.5 && val < 1.25 ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
|
||||
ViewboxFloatingBarScaleTransform.ScaleY =
|
||||
val > 0.5 && val < 1.25 ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
|
||||
|
||||
// 等待UI更新后再重新计算浮动栏位置,确保居中计算准确
|
||||
Dispatcher.BeginInvoke(new Action(async () =>
|
||||
{
|
||||
// 强制更新布局以确保ActualWidth正确
|
||||
ViewboxFloatingBar.UpdateLayout();
|
||||
|
||||
// 等待一小段时间让布局完全更新
|
||||
await Task.Delay(100);
|
||||
|
||||
// 再次强制更新布局
|
||||
ViewboxFloatingBar.UpdateLayout();
|
||||
|
||||
// 强制重新测量和排列
|
||||
ViewboxFloatingBar.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
ViewboxFloatingBar.Arrange(new Rect(ViewboxFloatingBar.DesiredSize));
|
||||
|
||||
// auto align - 新增:只在屏幕模式下重新计算浮动栏位置
|
||||
if (currentMode == 0)
|
||||
{
|
||||
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
|
||||
ViewboxFloatingBarMarginAnimation(60);
|
||||
else
|
||||
ViewboxFloatingBarMarginAnimation(100, true);
|
||||
}
|
||||
}), DispatcherPriority.Render);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理浮动栏透明度值滑块值更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当浮动栏透明度值滑块值更改时:
|
||||
/// 1. 保存浮动栏透明度设置
|
||||
/// 2. 应用透明度值到浮动栏
|
||||
/// </remarks>
|
||||
private void ViewboxFloatingBarOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.ViewboxFloatingBarOpacityValue = ViewboxFloatingBarOpacityValueSlider.Value;
|
||||
SaveSettingsToFile();
|
||||
ViewboxFloatingBar.Opacity = Settings.Appearance.ViewboxFloatingBarOpacityValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理PPT中浮动栏透明度值滑块值更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当PPT中浮动栏透明度值滑块值更改时,保存设置到文件
|
||||
/// </remarks>
|
||||
private void ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.ViewboxFloatingBarOpacityInPPTValue = ViewboxFloatingBarOpacityInPPTValueSlider.Value;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理托盘图标开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当托盘图标开关状态更改时:
|
||||
/// 1. 保存托盘图标设置
|
||||
/// 2. 根据设置显示或隐藏托盘图标示例图像
|
||||
/// 3. 根据设置显示或隐藏系统托盘图标
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableTrayIcon_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EnableTrayIcon = ToggleSwitchEnableTrayIcon.IsOn;
|
||||
ICCTrayIconExampleImage.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
|
||||
var _taskbar = (TaskbarIcon)Application.Current.Resources["TaskbarTrayIcon"];
|
||||
_taskbar.Visibility = ToggleSwitchEnableTrayIcon.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理展开按钮图像选择更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当选择展开按钮图像类型时:
|
||||
/// 1. 保存展开按钮图像类型设置
|
||||
/// 2. 根据选择的图像类型更新左右展开按钮的图标
|
||||
/// 3. 为不同的图像类型设置不同的大小和旋转角度
|
||||
/// </remarks>
|
||||
private void ComboBoxUnFoldBtnImg_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.UnFoldButtonImageType = ComboBoxUnFoldBtnImg.SelectedIndex;
|
||||
SaveSettingsToFile();
|
||||
if (ComboBoxUnFoldBtnImg.SelectedIndex == 0)
|
||||
{
|
||||
RightUnFoldBtnImgChevron.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
|
||||
RightUnFoldBtnImgChevron.Width = 14;
|
||||
RightUnFoldBtnImgChevron.Height = 14;
|
||||
RightUnFoldBtnImgChevron.RenderTransform = new RotateTransform(180);
|
||||
LeftUnFoldBtnImgChevron.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
|
||||
LeftUnFoldBtnImgChevron.Width = 14;
|
||||
LeftUnFoldBtnImgChevron.Height = 14;
|
||||
LeftUnFoldBtnImgChevron.RenderTransform = null;
|
||||
}
|
||||
else if (ComboBoxUnFoldBtnImg.SelectedIndex == 1)
|
||||
{
|
||||
RightUnFoldBtnImgChevron.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
|
||||
RightUnFoldBtnImgChevron.Width = 18;
|
||||
RightUnFoldBtnImgChevron.Height = 18;
|
||||
RightUnFoldBtnImgChevron.RenderTransform = null;
|
||||
LeftUnFoldBtnImgChevron.Source =
|
||||
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
|
||||
LeftUnFoldBtnImgChevron.Width = 18;
|
||||
LeftUnFoldBtnImgChevron.Height = 18;
|
||||
LeftUnFoldBtnImgChevron.RenderTransform = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly Lazy<object> HitokotoHttpClient = new Lazy<object>(CreateHitokotoClient, System.Threading.LazyThreadSafetyMode.ExecutionAndPublication);
|
||||
|
||||
@@ -462,7 +239,7 @@ namespace Ink_Canvas
|
||||
/// 当配置为内置来源时(0:OSUPlayer、1:名言警句、2:高考俗语)从对应数组中随机选择一条并设置为水印文本;
|
||||
/// 当配置为一言(3)时会异步请求 Hitokoto API 并在请求中显示占位提示,成功时将返回文本设为水印,失败时记录警告日志并设置可读的失败提示文本。此方法会修改 BlackBoardWaterMark.Text,并在发生异常时记录日志且设置合适的回退文本。
|
||||
/// </remarks>
|
||||
private async Task UpdateChickenSoupTextAsync()
|
||||
internal async Task UpdateChickenSoupTextAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -550,221 +327,8 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理名言来源选择更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当选择名言来源时:
|
||||
/// 1. 保存名言来源设置
|
||||
/// 2. 异步更新白板水印的名言文本
|
||||
/// </remarks>
|
||||
private async void ComboBoxChickenSoupSource_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_suppressChickenSoupSourceSelectionChanged) return;
|
||||
if (!isLoaded) return;
|
||||
int idx = ComboBoxChickenSoupSource.SelectedIndex;
|
||||
if (idx < 0) return;
|
||||
if (Settings.Appearance.ChickenSoupSource == idx) return;
|
||||
|
||||
Settings.Appearance.ChickenSoupSource = idx;
|
||||
|
||||
if (BtnHitokotoCustomize != null)
|
||||
{
|
||||
BtnHitokotoCustomize.Visibility = ComboBoxChickenSoupSource.SelectedIndex == 3
|
||||
? Visibility.Visible
|
||||
: Visibility.Collapsed;
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
await UpdateChickenSoupTextAsync();
|
||||
}
|
||||
|
||||
private async void BtnHitokotoCustomize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var categories = new Dictionary<string, string>
|
||||
{
|
||||
{ "a", "动画" },
|
||||
{ "b", "漫画" },
|
||||
{ "c", "游戏" },
|
||||
{ "d", "文学" },
|
||||
{ "e", "原创" },
|
||||
{ "f", "来自网络" },
|
||||
{ "g", "其他" },
|
||||
{ "h", "影视" },
|
||||
{ "i", "诗词" },
|
||||
{ "j", "网易云" },
|
||||
{ "k", "哲学" },
|
||||
{ "l", "抖机灵" }
|
||||
};
|
||||
|
||||
// 创建弹窗内容
|
||||
var contentPanel = new StackPanel
|
||||
{
|
||||
Margin = new Thickness(20),
|
||||
Orientation = System.Windows.Controls.Orientation.Vertical
|
||||
};
|
||||
|
||||
// 全选复选框
|
||||
var selectAllCheckBox = new CheckBox
|
||||
{
|
||||
Content = "全选",
|
||||
FontSize = 14,
|
||||
FontFamily = new FontFamily("Microsoft YaHei UI"),
|
||||
Margin = new Thickness(0, 0, 0, 8)
|
||||
};
|
||||
|
||||
// 存储各个分类的复选框
|
||||
var categoryCheckBoxes = new Dictionary<string, CheckBox>();
|
||||
|
||||
var savedHitokoto = Settings.Appearance.HitokotoCategories;
|
||||
bool implicitAllCategories = savedHitokoto == null || savedHitokoto.Count == 0;
|
||||
|
||||
// 创建分类复选框
|
||||
foreach (var category in categories)
|
||||
{
|
||||
var checkBox = new CheckBox
|
||||
{
|
||||
Content = category.Value,
|
||||
Tag = category.Key,
|
||||
FontSize = 13,
|
||||
FontFamily = new FontFamily("Microsoft YaHei UI"),
|
||||
IsChecked = implicitAllCategories || savedHitokoto.Contains(category.Key),
|
||||
Margin = new Thickness(0, 0, 0, 8)
|
||||
};
|
||||
categoryCheckBoxes[category.Key] = checkBox;
|
||||
contentPanel.Children.Add(checkBox);
|
||||
}
|
||||
|
||||
// 全选复选框逻辑
|
||||
bool isUpdatingSelectAll = false;
|
||||
selectAllCheckBox.IsChecked = implicitAllCategories || savedHitokoto.Count == categories.Count;
|
||||
|
||||
selectAllCheckBox.Checked += (s, args) =>
|
||||
{
|
||||
if (isUpdatingSelectAll) return;
|
||||
isUpdatingSelectAll = true;
|
||||
foreach (var checkBox in categoryCheckBoxes.Values)
|
||||
{
|
||||
checkBox.IsChecked = true;
|
||||
}
|
||||
isUpdatingSelectAll = false;
|
||||
};
|
||||
|
||||
selectAllCheckBox.Unchecked += (s, args) =>
|
||||
{
|
||||
if (isUpdatingSelectAll) return;
|
||||
isUpdatingSelectAll = true;
|
||||
foreach (var checkBox in categoryCheckBoxes.Values)
|
||||
{
|
||||
checkBox.IsChecked = false;
|
||||
}
|
||||
isUpdatingSelectAll = false;
|
||||
};
|
||||
|
||||
// 监听各个复选框的变化,更新全选状态
|
||||
foreach (var checkBox in categoryCheckBoxes.Values)
|
||||
{
|
||||
checkBox.Checked += (s, args) =>
|
||||
{
|
||||
if (isUpdatingSelectAll) return;
|
||||
isUpdatingSelectAll = true;
|
||||
// 检查所有分类复选框是否都被勾选
|
||||
bool allChecked = categoryCheckBoxes.Values.All(cb => cb.IsChecked == true);
|
||||
selectAllCheckBox.IsChecked = allChecked;
|
||||
isUpdatingSelectAll = false;
|
||||
};
|
||||
checkBox.Unchecked += (s, args) =>
|
||||
{
|
||||
if (isUpdatingSelectAll) return;
|
||||
isUpdatingSelectAll = true;
|
||||
selectAllCheckBox.IsChecked = false;
|
||||
isUpdatingSelectAll = false;
|
||||
};
|
||||
}
|
||||
|
||||
// 将全选复选框添加到顶部
|
||||
var mainPanel = new StackPanel
|
||||
{
|
||||
Margin = new Thickness(0),
|
||||
Orientation = System.Windows.Controls.Orientation.Vertical
|
||||
};
|
||||
mainPanel.Children.Add(selectAllCheckBox);
|
||||
mainPanel.Children.Add(new Separator { Margin = new Thickness(0, 8, 0, 8) });
|
||||
mainPanel.Children.Add(contentPanel);
|
||||
|
||||
var scrollViewer = new ScrollViewer
|
||||
{
|
||||
Content = mainPanel,
|
||||
MaxHeight = 400,
|
||||
VerticalScrollBarVisibility = ScrollBarVisibility.Auto
|
||||
};
|
||||
|
||||
// 创建ContentDialog显示自定义内容
|
||||
var contentDialog = new iNKORE.UI.WPF.Modern.Controls.ContentDialog
|
||||
{
|
||||
Title = "自定义一言分类",
|
||||
Content = scrollViewer,
|
||||
PrimaryButtonText = "确定",
|
||||
SecondaryButtonText = "取消",
|
||||
DefaultButton = iNKORE.UI.WPF.Modern.Controls.ContentDialogButton.Primary,
|
||||
Owner = this
|
||||
};
|
||||
|
||||
var dialogResult = await contentDialog.ShowAsync();
|
||||
|
||||
if (dialogResult == iNKORE.UI.WPF.Modern.Controls.ContentDialogResult.Primary)
|
||||
{
|
||||
// 保存选中的分类
|
||||
Settings.Appearance.HitokotoCategories = categoryCheckBoxes
|
||||
.Where(kvp => kvp.Value.IsChecked == true)
|
||||
.Select(kvp => kvp.Key)
|
||||
.ToList();
|
||||
|
||||
// 如果没有任何选中,默认全选
|
||||
if (Settings.Appearance.HitokotoCategories.Count == 0)
|
||||
{
|
||||
Settings.Appearance.HitokotoCategories = categories.Keys.ToList();
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 如果当前正在使用API,更新名言
|
||||
if (Settings.Appearance.ChickenSoupSource == 3 && Settings.Appearance.EnableChickenSoupInWhiteboardMode)
|
||||
{
|
||||
_ = UpdateChickenSoupTextAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EnableViewboxBlackBoardScaleTransform =
|
||||
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn;
|
||||
SaveSettingsToFile();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理浮动栏图标选择更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当选择浮动栏图标时:
|
||||
/// 1. 保存浮动栏图标设置
|
||||
/// 2. 更新浮动栏图标
|
||||
/// 3. 保存设置到文件
|
||||
/// </remarks>
|
||||
public void ComboBoxFloatingBarImg_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.FloatingBarImg = ComboBoxFloatingBarImg.SelectedIndex;
|
||||
UpdateFloatingBarIcon();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据设置更新浮动栏图标
|
||||
@@ -903,125 +467,9 @@ namespace Ink_Canvas
|
||||
/// </remarks>
|
||||
public void UpdateCustomIconsInComboBox()
|
||||
{
|
||||
// 保留前12个内置图标选项
|
||||
while (ComboBoxFloatingBarImg.Items.Count > 12)
|
||||
{
|
||||
ComboBoxFloatingBarImg.Items.RemoveAt(ComboBoxFloatingBarImg.Items.Count - 1);
|
||||
}
|
||||
|
||||
// 添加自定义图标选项
|
||||
foreach (var customIcon in Settings.Appearance.CustomFloatingBarImgs)
|
||||
{
|
||||
ComboBoxItem item = new ComboBoxItem();
|
||||
item.Content = customIcon.Name;
|
||||
item.FontFamily = new FontFamily("Microsoft YaHei UI");
|
||||
ComboBoxFloatingBarImg.Items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理添加自定义图标按钮点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当点击添加自定义图标按钮时:
|
||||
/// 1. 显示添加自定义图标窗口
|
||||
/// 2. 如果添加成功,自动选中新添加的图标
|
||||
/// </remarks>
|
||||
private void ButtonAddCustomIcon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddCustomIconWindow dialog = new AddCustomIconWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
|
||||
if (dialog.IsSuccess)
|
||||
{
|
||||
// 自动选中新添加的图标
|
||||
ComboBoxFloatingBarImg.SelectedIndex = ComboBoxFloatingBarImg.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理管理自定义图标按钮点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当点击管理自定义图标按钮时,显示自定义图标管理窗口
|
||||
/// </remarks>
|
||||
private void ButtonManageCustomIcons_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CustomIconWindow dialog = new CustomIconWindow(this);
|
||||
dialog.Owner = this;
|
||||
dialog.ShowDialog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理白板模式下时间显示开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当白板模式下时间显示开关状态更改时:
|
||||
/// 1. 保存时间显示设置
|
||||
/// 2. 如果当前是白板模式,根据设置显示或隐藏时间和日期水印
|
||||
/// 3. 保存设置到文件
|
||||
/// 4. 重新加载设置以应用更改
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EnableTimeDisplayInWhiteboardMode = ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn;
|
||||
if (currentMode == 1)
|
||||
{
|
||||
if (ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn)
|
||||
{
|
||||
WaterMarkTime.Visibility = Visibility.Visible;
|
||||
WaterMarkDate.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
WaterMarkTime.Visibility = Visibility.Collapsed;
|
||||
WaterMarkDate.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理白板模式下名言显示开关状态更改事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 当白板模式下名言显示开关状态更改时:
|
||||
/// 1. 保存名言显示设置
|
||||
/// 2. 如果当前是白板模式,根据时间显示设置显示或隐藏名言水印
|
||||
/// 3. 保存设置到文件
|
||||
/// 4. 重新加载设置以应用更改
|
||||
/// </remarks>
|
||||
private void ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EnableChickenSoupInWhiteboardMode = ToggleSwitchEnableChickenSoupInWhiteboardMode.IsOn;
|
||||
if (currentMode == 1)
|
||||
{
|
||||
if (ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn)
|
||||
{
|
||||
BlackBoardWaterMark.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlackBoardWaterMark.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
//[Obsolete]
|
||||
//private void ToggleSwitchShowButtonPPTNavigation_OnToggled(object sender, RoutedEventArgs e) {
|
||||
@@ -3747,183 +3195,8 @@ namespace Ink_Canvas
|
||||
|
||||
#region 浮动栏按钮显示控制
|
||||
|
||||
private void CheckBoxUseLegacyFloatingBarUI_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.UseLegacyFloatingBarUI = CheckBoxUseLegacyFloatingBarUI.IsChecked ?? false;
|
||||
UpdateFloatingBarIcons();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxUseLegacyFloatingBarUI_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.UseLegacyFloatingBarUI = CheckBoxUseLegacyFloatingBarUI.IsChecked ?? false;
|
||||
UpdateFloatingBarIcons();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowShapeButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowShapeButton = CheckBoxShowShapeButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowShapeButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowShapeButton = CheckBoxShowShapeButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowUndoButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowUndoButton = CheckBoxShowUndoButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowUndoButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowUndoButton = CheckBoxShowUndoButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowRedoButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowRedoButton = CheckBoxShowRedoButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowRedoButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowRedoButton = CheckBoxShowRedoButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowClearButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowClearButton = CheckBoxShowClearButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowClearButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowClearButton = CheckBoxShowClearButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowWhiteboardButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowWhiteboardButton = CheckBoxShowWhiteboardButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowWhiteboardButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowWhiteboardButton = CheckBoxShowWhiteboardButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowLassoSelectButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowLassoSelectButton = CheckBoxShowLassoSelectButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowLassoSelectButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowLassoSelectButton = CheckBoxShowLassoSelectButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowClearAndMouseButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowClearAndMouseButton = CheckBoxShowClearAndMouseButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowClearAndMouseButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowClearAndMouseButton = CheckBoxShowClearAndMouseButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowHideButton_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowHideButton = CheckBoxShowHideButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowHideButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowHideButton = CheckBoxShowHideButton.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowQuickColorPalette_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowQuickColorPalette = CheckBoxShowQuickColorPalette.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxShowQuickColorPalette_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.IsShowQuickColorPalette = CheckBoxShowQuickColorPalette.IsChecked ?? false;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxQuickColorPaletteDisplayMode_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.QuickColorPaletteDisplayMode = ComboBoxQuickColorPaletteDisplayMode.SelectedIndex;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxEraserDisplayOption_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Appearance.EraserDisplayOption = ComboBoxEraserDisplayOption.SelectedIndex;
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void UpdateFloatingBarButtonsVisibility()
|
||||
internal void UpdateFloatingBarButtonsVisibility()
|
||||
{
|
||||
// 根据设置更新浮动栏按钮的可见性
|
||||
try
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
// Appearance
|
||||
// Appearance - UI initialization (settings loading moved to AppearancePage)
|
||||
if (Settings.Appearance != null)
|
||||
{
|
||||
if (!Settings.Appearance.IsEnableDisPlayNibModeToggler)
|
||||
@@ -257,47 +257,16 @@ namespace Ink_Canvas
|
||||
NibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
|
||||
BoardNibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
NibModeSimpleStackPanel.Visibility = Visibility.Visible;
|
||||
BoardNibModeSimpleStackPanel.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
//if (Settings.Appearance.IsColorfulViewboxFloatingBar) // 浮动工具栏背景色
|
||||
//{
|
||||
// LinearGradientBrush gradientBrush = new LinearGradientBrush();
|
||||
// gradientBrush.StartPoint = new Point(0, 0);
|
||||
// gradientBrush.EndPoint = new Point(1, 1);
|
||||
// GradientStop blueStop = new GradientStop(Color.FromArgb(0x95, 0x80, 0xB0, 0xFF), 0);
|
||||
// GradientStop greenStop = new GradientStop(Color.FromArgb(0x95, 0xC0, 0xFF, 0xC0), 1);
|
||||
// gradientBrush.GradientStops.Add(blueStop);
|
||||
// gradientBrush.GradientStops.Add(greenStop);
|
||||
// EnableTwoFingerGestureBorder.Background = gradientBrush;
|
||||
// BorderFloatingBarMainControls.Background = gradientBrush;
|
||||
// BorderFloatingBarMoveControls.Background = gradientBrush;
|
||||
// BorderFloatingBarExitPPTBtn.Background = gradientBrush;
|
||||
|
||||
// ToggleSwitchColorfulViewboxFloatingBar.IsOn = true;
|
||||
//} else {
|
||||
// EnableTwoFingerGestureBorder.Background = (Brush)FindResource("FloatBarBackground");
|
||||
// BorderFloatingBarMainControls.Background = (Brush)FindResource("FloatBarBackground");
|
||||
// BorderFloatingBarMoveControls.Background = (Brush)FindResource("FloatBarBackground");
|
||||
// BorderFloatingBarExitPPTBtn.Background = (Brush)FindResource("FloatBarBackground");
|
||||
|
||||
// ToggleSwitchColorfulViewboxFloatingBar.IsOn = false;
|
||||
//}
|
||||
|
||||
if (Settings.Appearance.ViewboxFloatingBarScaleTransformValue != 0) // 浮动工具栏 UI 缩放 85%
|
||||
if (Settings.Appearance.ViewboxFloatingBarScaleTransformValue != 0)
|
||||
{
|
||||
double val = Settings.Appearance.ViewboxFloatingBarScaleTransformValue;
|
||||
ViewboxFloatingBarScaleTransform.ScaleX =
|
||||
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
|
||||
ViewboxFloatingBarScaleTransform.ScaleY =
|
||||
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
|
||||
ViewboxFloatingBarScaleTransformValueSlider.Value = val;
|
||||
}
|
||||
|
||||
ComboBoxUnFoldBtnImg.SelectedIndex = Settings.Appearance.UnFoldButtonImageType;
|
||||
switch (Settings.Appearance.UnFoldButtonImageType)
|
||||
{
|
||||
case 0:
|
||||
@@ -326,69 +295,17 @@ namespace Ink_Canvas
|
||||
break;
|
||||
}
|
||||
|
||||
// 设置主题下拉框
|
||||
ComboBoxTheme.SelectedIndex = Settings.Appearance.Theme;
|
||||
|
||||
_suppressChickenSoupSourceSelectionChanged = true;
|
||||
try
|
||||
{
|
||||
ComboBoxChickenSoupSource.SelectedIndex = Settings.Appearance.ChickenSoupSource;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Dispatcher.BeginInvoke(
|
||||
(Action)(() => { _suppressChickenSoupSourceSelectionChanged = false; }),
|
||||
DispatcherPriority.ContextIdle);
|
||||
}
|
||||
|
||||
// 初始化自定义按钮的可见性(仅在选择API时显示)
|
||||
if (BtnHitokotoCustomize != null)
|
||||
{
|
||||
BtnHitokotoCustomize.Visibility = Settings.Appearance.ChickenSoupSource == 3
|
||||
? Visibility.Visible
|
||||
: Visibility.Collapsed;
|
||||
}
|
||||
|
||||
|
||||
ToggleSwitchEnableQuickPanel.IsOn = Settings.Appearance.IsShowQuickPanel;
|
||||
|
||||
ToggleSwitchEnableSplashScreen.IsOn = Settings.Appearance.EnableSplashScreen;
|
||||
|
||||
ComboBoxSplashScreenStyle.SelectedIndex = Settings.Appearance.SplashScreenStyle;
|
||||
|
||||
ToggleSwitchEnableTrayIcon.IsOn = Settings.Appearance.EnableTrayIcon;
|
||||
ICCTrayIconExampleImage.Visibility =
|
||||
Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
|
||||
var _taskbar = (TaskbarIcon)Application.Current.Resources["TaskbarTrayIcon"];
|
||||
_taskbar.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
ViewboxFloatingBar.Opacity = Settings.Appearance.ViewboxFloatingBarOpacityValue;
|
||||
|
||||
// 初始化浮动栏透明度滑块值
|
||||
ViewboxFloatingBarOpacityValueSlider.Value = Settings.Appearance.ViewboxFloatingBarOpacityValue;
|
||||
ViewboxFloatingBarOpacityInPPTValueSlider.Value = Settings.Appearance.ViewboxFloatingBarOpacityInPPTValue;
|
||||
|
||||
if (Settings.Appearance.EnableViewboxBlackBoardScaleTransform) // 画板 UI 缩放 80%
|
||||
if (Settings.Appearance.EnableViewboxBlackBoardScaleTransform)
|
||||
{
|
||||
//ViewboxBlackboardLeftSideScaleTransform.ScaleX = 0.8;
|
||||
//ViewboxBlackboardLeftSideScaleTransform.ScaleY = 0.8;
|
||||
ViewboxBlackboardCenterSideScaleTransform.ScaleX = 0.8;
|
||||
ViewboxBlackboardCenterSideScaleTransform.ScaleY = 0.8;
|
||||
//ViewboxBlackboardRightSideScaleTransform.ScaleX = 0.8;
|
||||
//ViewboxBlackboardRightSideScaleTransform.ScaleY = 0.8;
|
||||
|
||||
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//ViewboxBlackboardLeftSideScaleTransform.ScaleX = 1;
|
||||
//ViewboxBlackboardLeftSideScaleTransform.ScaleY = 1;
|
||||
ViewboxBlackboardCenterSideScaleTransform.ScaleX = 1;
|
||||
ViewboxBlackboardCenterSideScaleTransform.ScaleY = 1;
|
||||
//ViewboxBlackboardRightSideScaleTransform.ScaleX = 1;
|
||||
//ViewboxBlackboardRightSideScaleTransform.ScaleY = 1;
|
||||
|
||||
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = false;
|
||||
}
|
||||
|
||||
if (Settings.Appearance.IsTransparentButtonBackground)
|
||||
@@ -397,58 +314,24 @@ namespace Ink_Canvas
|
||||
}
|
||||
else
|
||||
{
|
||||
//Light
|
||||
BtnExit.Background = BtnSwitchTheme.Content.ToString() == "深色"
|
||||
? new SolidColorBrush(StringToColor("#FFCCCCCC"))
|
||||
:
|
||||
//Dark
|
||||
new SolidColorBrush(StringToColor("#FF555555"));
|
||||
: new SolidColorBrush(StringToColor("#FF555555"));
|
||||
}
|
||||
|
||||
// 更新自定义图标下拉列表
|
||||
UpdateCustomIconsInComboBox();
|
||||
|
||||
// 设置选中的图标索引
|
||||
// 如果索引超出范围(自定义图标可能已删除),使用默认图标
|
||||
if (Settings.Appearance.FloatingBarImg >= ComboBoxFloatingBarImg.Items.Count)
|
||||
if (Settings.Appearance.FloatingBarImg >= 12 + Settings.Appearance.CustomFloatingBarImgs.Count)
|
||||
{
|
||||
Settings.Appearance.FloatingBarImg = 0;
|
||||
}
|
||||
|
||||
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
|
||||
|
||||
// 更新浮动栏图标
|
||||
UpdateFloatingBarIcon();
|
||||
|
||||
ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn =
|
||||
Settings.Appearance.EnableTimeDisplayInWhiteboardMode;
|
||||
|
||||
ToggleSwitchEnableChickenSoupInWhiteboardMode.IsOn =
|
||||
Settings.Appearance.EnableChickenSoupInWhiteboardMode;
|
||||
|
||||
// 浮动栏按钮显示控制开关初始化
|
||||
CheckBoxUseLegacyFloatingBarUI.IsChecked = Settings.Appearance.UseLegacyFloatingBarUI;
|
||||
CheckBoxShowShapeButton.IsChecked = Settings.Appearance.IsShowShapeButton;
|
||||
CheckBoxShowUndoButton.IsChecked = Settings.Appearance.IsShowUndoButton;
|
||||
CheckBoxShowRedoButton.IsChecked = Settings.Appearance.IsShowRedoButton;
|
||||
CheckBoxShowClearButton.IsChecked = Settings.Appearance.IsShowClearButton;
|
||||
CheckBoxShowWhiteboardButton.IsChecked = Settings.Appearance.IsShowWhiteboardButton;
|
||||
CheckBoxShowHideButton.IsChecked = Settings.Appearance.IsShowHideButton;
|
||||
CheckBoxShowQuickColorPalette.IsChecked = Settings.Appearance.IsShowQuickColorPalette;
|
||||
CheckBoxShowLassoSelectButton.IsChecked = Settings.Appearance.IsShowLassoSelectButton;
|
||||
CheckBoxShowClearAndMouseButton.IsChecked = Settings.Appearance.IsShowClearAndMouseButton;
|
||||
ComboBoxEraserDisplayOption.SelectedIndex = Settings.Appearance.EraserDisplayOption;
|
||||
ComboBoxQuickColorPaletteDisplayMode.SelectedIndex = Settings.Appearance.QuickColorPaletteDisplayMode;
|
||||
|
||||
// 初始化快捷调色盘指示器
|
||||
UpdateQuickColorPaletteIndicator(inkCanvas.DefaultDrawingAttributes.Color);
|
||||
|
||||
// 应用浮动栏按钮可见性设置
|
||||
UpdateFloatingBarButtonsVisibility();
|
||||
|
||||
// 更新浮动栏图标
|
||||
UpdateFloatingBarIcons();
|
||||
|
||||
var _taskbar = Application.Current.Resources["TaskbarTrayIcon"];
|
||||
if (_taskbar is FrameworkElement fe)
|
||||
fe.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
SystemEvents_UserPreferenceChanged(null, null);
|
||||
}
|
||||
else
|
||||
@@ -900,15 +783,8 @@ namespace Ink_Canvas
|
||||
// InkToShape
|
||||
if (Settings.InkToShape != null)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 直线拉直灵敏度在Canvas部分已经初始化,这里不再重复
|
||||
FloatingBarToggleSwitchEnableInkToShape.IsOn = Settings.InkToShape.IsInkToShapeEnabled;
|
||||
BoardToggleSwitchEnableInkToShape.IsOn = Settings.InkToShape.IsInkToShapeEnabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace Ink_Canvas
|
||||
MainWindow.Settings.Appearance.FloatingBarImg - 12 >= MainWindow.Settings.Appearance.CustomFloatingBarImgs.Count)
|
||||
{
|
||||
MainWindow.Settings.Appearance.FloatingBarImg = 0;
|
||||
mainWindow.ComboBoxFloatingBarImg.SelectedIndex = 0;
|
||||
mainWindow.UpdateFloatingBarIcon();
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=About_DeviceInfo}"
|
||||
IsExpanded="True">
|
||||
IsExpanded="True"
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AppearancePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
|
||||
mc:Ignorable="d"
|
||||
Title="{i18n:I18n Key=Theme_GroupTitle}">
|
||||
|
||||
<ScrollViewer PanningMode="VerticalFirst">
|
||||
<Grid Margin="59,0,59,0">
|
||||
<FrameworkElement.Resources>
|
||||
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
||||
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
|
||||
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
||||
TargetType="TextBlock">
|
||||
<Style.Setters>
|
||||
<Setter Property="Margin" Value="1,30,0,6" />
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
</FrameworkElement.Resources>
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel MaxWidth="1000"
|
||||
HorizontalAlignment="Stretch"
|
||||
Spacing="{StaticResource SettingsCardSpacing}">
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Theme_Label}" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_Label}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxTheme"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxTheme_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Light}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Dark}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_System}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_LanguageLabel}"
|
||||
Description="{i18n:I18n Key=Theme_Language_RestartHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Globe}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxLanguage"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxLanguage_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_System}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_ChineseSimplified}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_English}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Theme_EnableSplash}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableSplashScreen"
|
||||
Header="{i18n:I18n Key=Theme_EnableSplash}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Photo}"
|
||||
SwitchName="ToggleSwitchEnableSplashScreen"
|
||||
Toggled="ToggleSwitchEnableSplashScreen_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_SplashStyle}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Brightness}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxSplashScreenStyle"
|
||||
SelectedIndex="1"
|
||||
SelectionChanged="ComboBoxSplashScreenStyle_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Random}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Seasonal}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Spring}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Summer}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Autumn}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Winter}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Horse}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Theme_FloatingBarIcon}" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarIcon}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Photo}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxFloatingBarImg"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDefault}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccNoShadow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDark}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDarkBreath}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccWhiteTransparent}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccBlackTransparent}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkCrossEye}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkAbused}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkSmile}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkUnderwear}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkGreenHatDoge}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_TiebaEmoji}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8" Margin="0,4,0,0">
|
||||
<Button x:Name="ButtonAddCustomIcon" Content="{i18n:I18n Key=Theme_Upload}"
|
||||
Click="ButtonAddCustomIcon_Click" Padding="10,3"/>
|
||||
<Button x:Name="ButtonManageCustomIcons" Content="{i18n:I18n Key=Theme_Manage}"
|
||||
Click="ButtonManageCustomIcons_Click" Padding="10,3"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarScale}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Minimum="0.5"
|
||||
Maximum="1.25" Width="168"
|
||||
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarScaleTransformValueSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding ElementName=ViewboxFloatingBarScaleTransformValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontFamily="Consolas" Width="40" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarOpacity}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.EaseOfAccess}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Slider x:Name="ViewboxFloatingBarOpacityValueSlider" Minimum="0.3"
|
||||
Maximum="1" Width="168"
|
||||
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarOpacityValueSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding ElementName=ViewboxFloatingBarOpacityValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontFamily="Consolas" Width="40" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarOpacityInPPT}"
|
||||
Description="{i18n:I18n Key=Theme_FloatingBarOpacityInPPTHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Slider x:Name="ViewboxFloatingBarOpacityInPPTValueSlider" Minimum="0.3"
|
||||
Maximum="1" Width="168"
|
||||
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
|
||||
TickPlacement="None" AutoToolTipPlacement="None"
|
||||
ValueChanged="ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding ElementName=ViewboxFloatingBarOpacityInPPTValueSlider, Path=Value}"
|
||||
VerticalAlignment="Center" FontFamily="Consolas" Width="40" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableDisPlayNibModeToggle"
|
||||
Header="{i18n:I18n Key=Theme_ShowNibButton}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
|
||||
SwitchName="ToggleSwitchEnableDisPlayNibModeToggle"
|
||||
Toggled="ToggleSwitchEnableDisPlayNibModeToggle_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableViewboxBlackBoardScaleTransform"
|
||||
Header="{i18n:I18n Key=Theme_BlackboardScale80}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.BackToWindow}"
|
||||
SwitchName="ToggleSwitchEnableViewboxBlackBoardScaleTransform"
|
||||
Toggled="ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableTimeDisplayInWhiteboardMode"
|
||||
Header="{i18n:I18n Key=Theme_ShowTimeInWhiteboard}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Pinned}"
|
||||
SwitchName="ToggleSwitchEnableTimeDisplayInWhiteboardMode"
|
||||
Toggled="ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableChickenSoupInWhiteboardMode"
|
||||
Header="{i18n:I18n Key=Theme_ShowQuoteInWhiteboard}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Message}"
|
||||
SwitchName="ToggleSwitchEnableChickenSoupInWhiteboardMode"
|
||||
Toggled="ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_QuoteSource}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Heart}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
|
||||
<ComboBox x:Name="ComboBoxChickenSoupSource"
|
||||
Width="240"
|
||||
SelectionChanged="ComboBoxChickenSoupSource_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_OsuQuotes}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Mottos}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_GaokaoBless}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Hitokoto}" />
|
||||
</ComboBox>
|
||||
<Button x:Name="BtnHitokotoCustomize" Content="{i18n:I18n Key=Theme_Customize}"
|
||||
Padding="14,4" MinWidth="65" VerticalAlignment="Center"
|
||||
Click="BtnHitokotoCustomize_Click"
|
||||
Visibility="Collapsed" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableQuickPanel"
|
||||
Header="{i18n:I18n Key=Theme_EnableQuickPanel}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Pinned}"
|
||||
SwitchName="ToggleSwitchEnableQuickPanel"
|
||||
Toggled="ToggleSwitchEnableQuickPanel_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_UnfoldButtonIcon}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChevronRight}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxUnFoldBtnImg"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxUnFoldBtnImg_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Arrow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Pen}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Theme_FloatingBarButtonsTitle}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardUseLegacyFloatingBarUI"
|
||||
Header="{i18n:I18n Key=Theme_UseLegacyFloatingBarUI}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.History}"
|
||||
SwitchName="ToggleSwitchUseLegacyFloatingBarUI"
|
||||
Toggled="ToggleSwitchUseLegacyFloatingBarUI_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=Theme_FloatingBarButtonsTitle}"
|
||||
IsExpanded="True"
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ViewAll}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowShapeButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowShapeButton}"
|
||||
Checked="CheckBoxShowShapeButton_Changed" Unchecked="CheckBoxShowShapeButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowUndoButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowUndoButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowRedoButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowRedoButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowClearButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowClearButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowWhiteboardButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowWhiteboardButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowHideButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowHideButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowLassoSelectButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowLassoButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowClearAndMouseButton" IsChecked="True"
|
||||
Content="{i18n:I18n Key=Theme_ShowClearAndMouseButton}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxShowQuickColorPalette" IsChecked="False"
|
||||
Content="{i18n:I18n Key=Theme_ShowQuickPalette}"
|
||||
Checked="CheckBoxShowButton_Changed" Unchecked="CheckBoxShowButton_Changed" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_QuickPaletteMode}">
|
||||
<ComboBox x:Name="ComboBoxQuickColorPaletteDisplayMode"
|
||||
SelectedIndex="1"
|
||||
SelectionChanged="ComboBoxQuickColorPaletteDisplayMode_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_SingleRow}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_DoubleRow}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Theme_EraserButtonDisplay}">
|
||||
<ComboBox x:Name="ComboBoxEraserDisplayOption"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxEraserDisplayOption_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_Both}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_AreaOnly}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_LineOnly}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_None}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Tray_GroupTitle}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableTrayIcon"
|
||||
Header="{i18n:I18n Key=Tray_EnableTrayIcon}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Pin}"
|
||||
SwitchName="ToggleSwitchEnableTrayIcon"
|
||||
Toggled="ToggleSwitchEnableTrayIcon_Toggled" />
|
||||
|
||||
<Rectangle Height="48" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ui:Page>
|
||||
@@ -0,0 +1,513 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using ContentDialog = iNKORE.UI.WPF.Modern.Controls.ContentDialog;
|
||||
using Page = iNKORE.UI.WPF.Modern.Controls.Page;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
public partial class AppearancePage : Page
|
||||
{
|
||||
private bool _isLoaded = false;
|
||||
private bool _suppressChickenSoupSourceSelectionChanged = false;
|
||||
private bool _isApplyingLanguageFromSettings = false;
|
||||
|
||||
public AppearancePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += Page_Loaded;
|
||||
Unloaded += Page_Unloaded;
|
||||
}
|
||||
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
private void Page_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_isLoaded = false;
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
var settings = SettingsManager.Settings;
|
||||
if (settings?.Appearance == null) return;
|
||||
|
||||
ComboBoxTheme.SelectedIndex = settings.Appearance.Theme;
|
||||
|
||||
_isApplyingLanguageFromSettings = true;
|
||||
try
|
||||
{
|
||||
var lang = settings.Appearance.Language ?? string.Empty;
|
||||
int langIndex = string.IsNullOrWhiteSpace(lang) ? 0 :
|
||||
string.Equals(lang, "zh-CN", StringComparison.OrdinalIgnoreCase) ? 1 :
|
||||
string.Equals(lang, "en-US", StringComparison.OrdinalIgnoreCase) ? 2 : 0;
|
||||
ComboBoxLanguage.SelectedIndex = langIndex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isApplyingLanguageFromSettings = false;
|
||||
}
|
||||
|
||||
CardEnableSplashScreen.IsOn = settings.Appearance.EnableSplashScreen;
|
||||
ComboBoxSplashScreenStyle.SelectedIndex = settings.Appearance.SplashScreenStyle;
|
||||
|
||||
if (settings.Appearance.FloatingBarImg >= ComboBoxFloatingBarImg.Items.Count)
|
||||
settings.Appearance.FloatingBarImg = 0;
|
||||
ComboBoxFloatingBarImg.SelectedIndex = settings.Appearance.FloatingBarImg;
|
||||
|
||||
if (settings.Appearance.ViewboxFloatingBarScaleTransformValue != 0)
|
||||
ViewboxFloatingBarScaleTransformValueSlider.Value = settings.Appearance.ViewboxFloatingBarScaleTransformValue;
|
||||
|
||||
ViewboxFloatingBarOpacityValueSlider.Value = settings.Appearance.ViewboxFloatingBarOpacityValue;
|
||||
ViewboxFloatingBarOpacityInPPTValueSlider.Value = settings.Appearance.ViewboxFloatingBarOpacityInPPTValue;
|
||||
|
||||
CardEnableDisPlayNibModeToggle.IsOn = settings.Appearance.IsEnableDisPlayNibModeToggler;
|
||||
CardEnableViewboxBlackBoardScaleTransform.IsOn = settings.Appearance.EnableViewboxBlackBoardScaleTransform;
|
||||
CardEnableTimeDisplayInWhiteboardMode.IsOn = settings.Appearance.EnableTimeDisplayInWhiteboardMode;
|
||||
CardEnableChickenSoupInWhiteboardMode.IsOn = settings.Appearance.EnableChickenSoupInWhiteboardMode;
|
||||
|
||||
_suppressChickenSoupSourceSelectionChanged = true;
|
||||
try
|
||||
{
|
||||
ComboBoxChickenSoupSource.SelectedIndex = settings.Appearance.ChickenSoupSource;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Dispatcher.BeginInvoke(
|
||||
(Action)(() => { _suppressChickenSoupSourceSelectionChanged = false; }),
|
||||
DispatcherPriority.ContextIdle);
|
||||
}
|
||||
|
||||
CardEnableQuickPanel.IsOn = settings.Appearance.IsShowQuickPanel;
|
||||
ComboBoxUnFoldBtnImg.SelectedIndex = settings.Appearance.UnFoldButtonImageType;
|
||||
|
||||
CardUseLegacyFloatingBarUI.IsOn = settings.Appearance.UseLegacyFloatingBarUI;
|
||||
CheckBoxShowShapeButton.IsChecked = settings.Appearance.IsShowShapeButton;
|
||||
CheckBoxShowUndoButton.IsChecked = settings.Appearance.IsShowUndoButton;
|
||||
CheckBoxShowRedoButton.IsChecked = settings.Appearance.IsShowRedoButton;
|
||||
CheckBoxShowClearButton.IsChecked = settings.Appearance.IsShowClearButton;
|
||||
CheckBoxShowWhiteboardButton.IsChecked = settings.Appearance.IsShowWhiteboardButton;
|
||||
CheckBoxShowHideButton.IsChecked = settings.Appearance.IsShowHideButton;
|
||||
CheckBoxShowLassoSelectButton.IsChecked = settings.Appearance.IsShowLassoSelectButton;
|
||||
CheckBoxShowClearAndMouseButton.IsChecked = settings.Appearance.IsShowClearAndMouseButton;
|
||||
CheckBoxShowQuickColorPalette.IsChecked = settings.Appearance.IsShowQuickColorPalette;
|
||||
ComboBoxQuickColorPaletteDisplayMode.SelectedIndex = settings.Appearance.QuickColorPaletteDisplayMode;
|
||||
ComboBoxEraserDisplayOption.SelectedIndex = settings.Appearance.EraserDisplayOption;
|
||||
|
||||
CardEnableTrayIcon.IsOn = settings.Appearance.EnableTrayIcon;
|
||||
}
|
||||
|
||||
private MainWindow GetMainWindow() => Application.Current.MainWindow as MainWindow;
|
||||
|
||||
#region Theme & Language
|
||||
|
||||
private void ComboBoxTheme_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
try
|
||||
{
|
||||
SettingsManager.Settings.Appearance.Theme = ComboBoxTheme.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.ApplyTheme(ComboBoxTheme.SelectedIndex);
|
||||
}
|
||||
catch (Exception ex) { Debug.WriteLine($"切换主题时出错: {ex.Message}"); }
|
||||
}
|
||||
|
||||
private void ComboBoxLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded || _isApplyingLanguageFromSettings) return;
|
||||
try
|
||||
{
|
||||
var index = ComboBoxLanguage.SelectedIndex;
|
||||
string language = index switch
|
||||
{
|
||||
1 => "zh-CN",
|
||||
2 => "en-US",
|
||||
_ => string.Empty
|
||||
};
|
||||
SettingsManager.Settings.Appearance.Language = language;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
LocalizationHelper.TrySetCulture(language);
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null)
|
||||
{
|
||||
mw._isReloadingForLanguageChange = true;
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var newWindow = new MainWindow
|
||||
{
|
||||
WindowState = mw.WindowState,
|
||||
Left = mw.Left,
|
||||
Top = mw.Top
|
||||
};
|
||||
newWindow.Show();
|
||||
mw.Close();
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
Debug.WriteLine($"重建主窗口以应用语言时出错: {ex2.Message}");
|
||||
mw._isReloadingForLanguageChange = false;
|
||||
}
|
||||
}), DispatcherPriority.ApplicationIdle);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { Debug.WriteLine($"切换界面语言时出错: {ex.Message}"); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Splash Screen
|
||||
|
||||
private void ToggleSwitchEnableSplashScreen_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EnableSplashScreen = CardEnableSplashScreen.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxSplashScreenStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.SplashScreenStyle = ComboBoxSplashScreenStyle.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Floating Bar Appearance
|
||||
|
||||
private void ComboBoxFloatingBarImg_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.FloatingBarImg = ComboBoxFloatingBarImg.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarIcon();
|
||||
}
|
||||
|
||||
private void ButtonAddCustomIcon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var mw = GetMainWindow();
|
||||
if (mw == null) return;
|
||||
AddCustomIconWindow dialog = new AddCustomIconWindow(mw);
|
||||
dialog.Owner = mw;
|
||||
dialog.ShowDialog();
|
||||
if (dialog.IsSuccess)
|
||||
{
|
||||
ComboBoxFloatingBarImg.SelectedIndex = ComboBoxFloatingBarImg.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonManageCustomIcons_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var mw = GetMainWindow();
|
||||
if (mw == null) return;
|
||||
CustomIconWindow dialog = new CustomIconWindow(mw);
|
||||
dialog.Owner = mw;
|
||||
dialog.ShowDialog();
|
||||
}
|
||||
|
||||
private void ViewboxFloatingBarScaleTransformValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
var val = ViewboxFloatingBarScaleTransformValueSlider.Value;
|
||||
SettingsManager.Settings.Appearance.ViewboxFloatingBarScaleTransformValue = val;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null)
|
||||
{
|
||||
mw.ViewboxFloatingBarScaleTransform.ScaleX = val > 0.5 && val < 1.25 ? val : val <= 0.5 ? 0.5 : 1.25;
|
||||
mw.ViewboxFloatingBarScaleTransform.ScaleY = val > 0.5 && val < 1.25 ? val : val <= 0.5 ? 0.5 : 1.25;
|
||||
}
|
||||
}
|
||||
|
||||
private void ViewboxFloatingBarOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.ViewboxFloatingBarOpacityValue = ViewboxFloatingBarOpacityValueSlider.Value;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.ViewboxFloatingBar.Opacity = ViewboxFloatingBarOpacityValueSlider.Value;
|
||||
}
|
||||
|
||||
private void ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.ViewboxFloatingBarOpacityInPPTValue = ViewboxFloatingBarOpacityInPPTValueSlider.Value;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Display Options
|
||||
|
||||
private void ToggleSwitchEnableDisPlayNibModeToggle_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.IsEnableDisPlayNibModeToggler = CardEnableDisPlayNibModeToggle.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null)
|
||||
{
|
||||
var vis = CardEnableDisPlayNibModeToggle.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
mw.NibModeSimpleStackPanel.Visibility = vis;
|
||||
mw.BoardNibModeSimpleStackPanel.Visibility = vis;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EnableViewboxBlackBoardScaleTransform = CardEnableViewboxBlackBoardScaleTransform.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null)
|
||||
{
|
||||
var scale = CardEnableViewboxBlackBoardScaleTransform.IsOn ? 0.8 : 1.0;
|
||||
mw.ViewboxBlackboardCenterSideScaleTransform.ScaleX = scale;
|
||||
mw.ViewboxBlackboardCenterSideScaleTransform.ScaleY = scale;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EnableTimeDisplayInWhiteboardMode = CardEnableTimeDisplayInWhiteboardMode.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null && mw.currentMode == 1)
|
||||
{
|
||||
var vis = CardEnableTimeDisplayInWhiteboardMode.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
mw.WaterMarkTime.Visibility = vis;
|
||||
mw.WaterMarkDate.Visibility = vis;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EnableChickenSoupInWhiteboardMode = CardEnableChickenSoupInWhiteboardMode.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null && mw.currentMode == 1 && CardEnableTimeDisplayInWhiteboardMode.IsOn)
|
||||
{
|
||||
mw.BlackBoardWaterMark.Visibility = CardEnableChickenSoupInWhiteboardMode.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
private async void ComboBoxChickenSoupSource_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (_suppressChickenSoupSourceSelectionChanged || !_isLoaded) return;
|
||||
int idx = ComboBoxChickenSoupSource.SelectedIndex;
|
||||
if (idx < 0) return;
|
||||
if (SettingsManager.Settings.Appearance.ChickenSoupSource == idx) return;
|
||||
SettingsManager.Settings.Appearance.ChickenSoupSource = idx;
|
||||
if (BtnHitokotoCustomize != null)
|
||||
BtnHitokotoCustomize.Visibility = idx == 3 ? Visibility.Visible : Visibility.Collapsed;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) await mw.UpdateChickenSoupTextAsync();
|
||||
}
|
||||
|
||||
private async void BtnHitokotoCustomize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var categories = new System.Collections.Generic.Dictionary<string, string>
|
||||
{
|
||||
{ "a", "动画" }, { "b", "漫画" }, { "c", "游戏" }, { "d", "文学" },
|
||||
{ "e", "原创" }, { "f", "来自网络" }, { "g", "其他" }, { "h", "影视" },
|
||||
{ "i", "诗词" }, { "j", "网易云" }, { "k", "哲学" }, { "l", "抖机灵" }
|
||||
};
|
||||
|
||||
var contentPanel = new StackPanel { Margin = new Thickness(20), Orientation = Orientation.Vertical };
|
||||
var selectAllCheckBox = new CheckBox { Content = "全选", FontSize = 14, Margin = new Thickness(0, 0, 0, 8) };
|
||||
var categoryCheckBoxes = new System.Collections.Generic.Dictionary<string, CheckBox>();
|
||||
var savedHitokoto = SettingsManager.Settings.Appearance.HitokotoCategories;
|
||||
bool implicitAllCategories = savedHitokoto == null || savedHitokoto.Count == 0;
|
||||
|
||||
foreach (var category in categories)
|
||||
{
|
||||
var checkBox = new CheckBox
|
||||
{
|
||||
Content = category.Value, Tag = category.Key, FontSize = 13,
|
||||
IsChecked = implicitAllCategories || savedHitokoto.Contains(category.Key),
|
||||
Margin = new Thickness(0, 0, 0, 8)
|
||||
};
|
||||
categoryCheckBoxes[category.Key] = checkBox;
|
||||
contentPanel.Children.Add(checkBox);
|
||||
}
|
||||
|
||||
bool isUpdatingSelectAll = false;
|
||||
selectAllCheckBox.IsChecked = implicitAllCategories || savedHitokoto.Count == categories.Count;
|
||||
selectAllCheckBox.Checked += (s, args) => { if (isUpdatingSelectAll) return; isUpdatingSelectAll = true; foreach (var cb in categoryCheckBoxes.Values) cb.IsChecked = true; isUpdatingSelectAll = false; };
|
||||
selectAllCheckBox.Unchecked += (s, args) => { if (isUpdatingSelectAll) return; isUpdatingSelectAll = true; foreach (var cb in categoryCheckBoxes.Values) cb.IsChecked = false; isUpdatingSelectAll = false; };
|
||||
foreach (var cb in categoryCheckBoxes.Values)
|
||||
{
|
||||
cb.Checked += (s, args) => { if (isUpdatingSelectAll) return; isUpdatingSelectAll = true; selectAllCheckBox.IsChecked = categoryCheckBoxes.Values.All(c => c.IsChecked == true); isUpdatingSelectAll = false; };
|
||||
cb.Unchecked += (s, args) => { if (isUpdatingSelectAll) return; isUpdatingSelectAll = true; selectAllCheckBox.IsChecked = false; isUpdatingSelectAll = false; };
|
||||
}
|
||||
|
||||
var mainPanel = new StackPanel();
|
||||
mainPanel.Children.Add(selectAllCheckBox);
|
||||
mainPanel.Children.Add(new Separator { Margin = new Thickness(0, 8, 0, 8) });
|
||||
mainPanel.Children.Add(contentPanel);
|
||||
|
||||
var mw = GetMainWindow();
|
||||
var contentDialog = new ContentDialog
|
||||
{
|
||||
Title = "自定义一言分类",
|
||||
Content = new ScrollViewer { Content = mainPanel, MaxHeight = 400, VerticalScrollBarVisibility = ScrollBarVisibility.Auto },
|
||||
PrimaryButtonText = "确定",
|
||||
SecondaryButtonText = "取消",
|
||||
DefaultButton = ContentDialogButton.Primary,
|
||||
Owner = mw
|
||||
};
|
||||
|
||||
var dialogResult = await contentDialog.ShowAsync();
|
||||
if (dialogResult == ContentDialogResult.Primary)
|
||||
{
|
||||
SettingsManager.Settings.Appearance.HitokotoCategories = categoryCheckBoxes.Where(kvp => kvp.Value.IsChecked == true).Select(kvp => kvp.Key).ToList();
|
||||
if (SettingsManager.Settings.Appearance.HitokotoCategories.Count == 0)
|
||||
SettingsManager.Settings.Appearance.HitokotoCategories = categories.Keys.ToList();
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
if (SettingsManager.Settings.Appearance.ChickenSoupSource == 3 && SettingsManager.Settings.Appearance.EnableChickenSoupInWhiteboardMode)
|
||||
{
|
||||
if (mw != null) await mw.UpdateChickenSoupTextAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableQuickPanel_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.IsShowQuickPanel = CardEnableQuickPanel.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxUnFoldBtnImg_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.UnFoldButtonImageType = ComboBoxUnFoldBtnImg.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null)
|
||||
{
|
||||
if (ComboBoxUnFoldBtnImg.SelectedIndex == 0)
|
||||
{
|
||||
mw.RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
|
||||
mw.RightUnFoldBtnImgChevron.Width = 14; mw.RightUnFoldBtnImgChevron.Height = 14;
|
||||
mw.RightUnFoldBtnImgChevron.RenderTransform = new RotateTransform(180);
|
||||
mw.LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
|
||||
mw.LeftUnFoldBtnImgChevron.Width = 14; mw.LeftUnFoldBtnImgChevron.Height = 14;
|
||||
mw.LeftUnFoldBtnImgChevron.RenderTransform = null;
|
||||
}
|
||||
else if (ComboBoxUnFoldBtnImg.SelectedIndex == 1)
|
||||
{
|
||||
mw.RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
|
||||
mw.RightUnFoldBtnImgChevron.Width = 18; mw.RightUnFoldBtnImgChevron.Height = 18;
|
||||
mw.RightUnFoldBtnImgChevron.RenderTransform = null;
|
||||
mw.LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
|
||||
mw.LeftUnFoldBtnImgChevron.Width = 18; mw.LeftUnFoldBtnImgChevron.Height = 18;
|
||||
mw.LeftUnFoldBtnImgChevron.RenderTransform = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Floating Bar Buttons
|
||||
|
||||
private void ToggleSwitchUseLegacyFloatingBarUI_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.UseLegacyFloatingBarUI = CardUseLegacyFloatingBarUI.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarIcons();
|
||||
}
|
||||
|
||||
private void CheckBoxShowShapeButton_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.IsShowShapeButton = CheckBoxShowShapeButton.IsChecked ?? false;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarButtonsVisibility();
|
||||
}
|
||||
|
||||
private void CheckBoxShowButton_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (sender == CheckBoxShowUndoButton)
|
||||
SettingsManager.Settings.Appearance.IsShowUndoButton = CheckBoxShowUndoButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowRedoButton)
|
||||
SettingsManager.Settings.Appearance.IsShowRedoButton = CheckBoxShowRedoButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowClearButton)
|
||||
SettingsManager.Settings.Appearance.IsShowClearButton = CheckBoxShowClearButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowWhiteboardButton)
|
||||
SettingsManager.Settings.Appearance.IsShowWhiteboardButton = CheckBoxShowWhiteboardButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowHideButton)
|
||||
SettingsManager.Settings.Appearance.IsShowHideButton = CheckBoxShowHideButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowLassoSelectButton)
|
||||
SettingsManager.Settings.Appearance.IsShowLassoSelectButton = CheckBoxShowLassoSelectButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowClearAndMouseButton)
|
||||
SettingsManager.Settings.Appearance.IsShowClearAndMouseButton = CheckBoxShowClearAndMouseButton.IsChecked ?? false;
|
||||
else if (sender == CheckBoxShowQuickColorPalette)
|
||||
SettingsManager.Settings.Appearance.IsShowQuickColorPalette = CheckBoxShowQuickColorPalette.IsChecked ?? false;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarButtonsVisibility();
|
||||
}
|
||||
|
||||
private void ComboBoxQuickColorPaletteDisplayMode_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.QuickColorPaletteDisplayMode = ComboBoxQuickColorPaletteDisplayMode.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarButtonsVisibility();
|
||||
}
|
||||
|
||||
private void ComboBoxEraserDisplayOption_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EraserDisplayOption = ComboBoxEraserDisplayOption.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
var mw = GetMainWindow();
|
||||
if (mw != null) mw.UpdateFloatingBarButtonsVisibility();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Tray Icon
|
||||
|
||||
private void ToggleSwitchEnableTrayIcon_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Appearance.EnableTrayIcon = CardEnableTrayIcon.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
try
|
||||
{
|
||||
var _taskbar = Application.Current.Resources["TaskbarTrayIcon"];
|
||||
if (_taskbar is FrameworkElement fe)
|
||||
fe.Visibility = CardEnableTrayIcon.IsOn ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -133,20 +133,17 @@
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableInkFade"
|
||||
<ui:SettingsExpander x:Name="ExpanderEnableInkFade"
|
||||
Header="{i18n:I18n Key=Canvas_EnableInkFade}"
|
||||
Description="{i18n:I18n Key=Canvas_EnableInkFadeHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Color}"
|
||||
SwitchName="ToggleSwitchEnableInkFade"
|
||||
Toggled="ToggleSwitchEnableInkFade_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=Canvas_EnableInkFade}"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableInkFade, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardEnableInkFade, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchEnableInkFade"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchEnableInkFade_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_InkFadeTime}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
@@ -167,20 +164,17 @@
|
||||
SwitchName="ToggleSwitchHideInkFadeControlInPenMenu"
|
||||
Toggled="ToggleSwitchHideInkFadeControlInPenMenu_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardBrushAutoRestore"
|
||||
<ui:SettingsExpander x:Name="ExpanderBrushAutoRestore"
|
||||
Header="{i18n:I18n Key=Canvas_BrushAutoRestore}"
|
||||
Description="{i18n:I18n Key=Canvas_BrushAutoRestoreHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Refresh}"
|
||||
SwitchName="ToggleSwitchBrushAutoRestore"
|
||||
Toggled="ToggleSwitchBrushAutoRestore_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=Canvas_BrushAutoRestore}"
|
||||
Visibility="{Binding IsOn, ElementName=CardBrushAutoRestore, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardBrushAutoRestore, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Refresh}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchBrushAutoRestore"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchBrushAutoRestore_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_AutoRestoreTimePoints}">
|
||||
<TextBox x:Name="BrushAutoRestoreTimesTextBox" Width="260"
|
||||
@@ -221,20 +215,17 @@
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableEraserAutoSwitchBack"
|
||||
<ui:SettingsExpander x:Name="ExpanderEnableEraserAutoSwitchBack"
|
||||
Header="{i18n:I18n Key=Canvas_SwitchBackAfterEraser}"
|
||||
Description="{i18n:I18n Key=Canvas_SwitchBackAfterEraserHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Switch}"
|
||||
SwitchName="ToggleSwitchEnableEraserAutoSwitchBack"
|
||||
Toggled="ToggleSwitchEnableEraserAutoSwitchBack_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=Canvas_SwitchBackAfterEraser}"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableEraserAutoSwitchBack, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardEnableEraserAutoSwitchBack, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Switch}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchEnableEraserAutoSwitchBack"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchEnableEraserAutoSwitchBack_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_SwitchBackDelay}"
|
||||
Description="{i18n:I18n Key=Canvas_SwitchBackDelayHint}">
|
||||
@@ -266,20 +257,17 @@
|
||||
SwitchName="ToggleSwitchEnableTwoFingerRotationOnSelection"
|
||||
Toggled="ToggleSwitchEnableTwoFingerRotationOnSelection_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnablePalmEraser"
|
||||
<ui:SettingsExpander x:Name="ExpanderEnablePalmEraser"
|
||||
Header="{i18n:I18n Key=Gesture_EnablePalmEraser}"
|
||||
Description="{i18n:I18n Key=Gesture_PalmHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.EraseTool}"
|
||||
SwitchName="ToggleSwitchEnablePalmEraser"
|
||||
Toggled="ToggleSwitchEnablePalmEraser_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=Gesture_EnablePalmEraser}"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnablePalmEraser, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardEnablePalmEraser, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.EraseTool}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchEnablePalmEraser"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchEnablePalmEraser_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Gesture_PalmSensitivity}">
|
||||
<ComboBox x:Name="ComboBoxPalmEraserSensitivity"
|
||||
|
||||
@@ -46,15 +46,15 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
if (settings.Canvas.UseAdvancedBezierSmoothing) curveMode = 2;
|
||||
else if (settings.Canvas.FitToCurve) curveMode = 1;
|
||||
ComboBoxCurveSmoothingMode.SelectedIndex = curveMode;
|
||||
CardEnableInkFade.IsOn = settings.Canvas.EnableInkFade;
|
||||
ToggleSwitchEnableInkFade.IsOn = settings.Canvas.EnableInkFade;
|
||||
InkFadeTimeSlider.Value = settings.Canvas.InkFadeTime;
|
||||
CardHideInkFadeControlInPenMenu.IsOn = settings.Canvas.HideInkFadeControlInPenMenu;
|
||||
CardBrushAutoRestore.IsOn = settings.Canvas.EnableBrushAutoRestore;
|
||||
ToggleSwitchBrushAutoRestore.IsOn = settings.Canvas.EnableBrushAutoRestore;
|
||||
BrushAutoRestoreTimesTextBox.Text = settings.Canvas.BrushAutoRestoreTimes ?? string.Empty;
|
||||
LoadBrushAutoRestoreColor(settings.Canvas.BrushAutoRestoreColor);
|
||||
BrushAutoRestoreWidthSlider.Value = settings.Canvas.BrushAutoRestoreWidth > 0 ? settings.Canvas.BrushAutoRestoreWidth : 5;
|
||||
BrushAutoRestoreAlphaSlider.Value = settings.Canvas.BrushAutoRestoreAlpha;
|
||||
CardEnableEraserAutoSwitchBack.IsOn = settings.Canvas.EnableEraserAutoSwitchBack;
|
||||
ToggleSwitchEnableEraserAutoSwitchBack.IsOn = settings.Canvas.EnableEraserAutoSwitchBack;
|
||||
EraserAutoSwitchBackDelaySlider.Value = settings.Canvas.EraserAutoSwitchBackDelaySeconds;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
if (settings.Canvas != null)
|
||||
{
|
||||
CardEnablePalmEraser.IsOn = settings.Canvas.EnablePalmEraser;
|
||||
ToggleSwitchEnablePalmEraser.IsOn = settings.Canvas.EnablePalmEraser;
|
||||
ComboBoxPalmEraserSensitivity.SelectedIndex = settings.Canvas.PalmEraserSensitivity;
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,11 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
}
|
||||
|
||||
_isLoaded = true;
|
||||
|
||||
ExpanderEnableInkFade.IsExpanded = ToggleSwitchEnableInkFade.IsOn;
|
||||
ExpanderBrushAutoRestore.IsExpanded = ToggleSwitchBrushAutoRestore.IsOn;
|
||||
ExpanderEnableEraserAutoSwitchBack.IsExpanded = ToggleSwitchEnableEraserAutoSwitchBack.IsOn;
|
||||
ExpanderEnablePalmEraser.IsExpanded = ToggleSwitchEnablePalmEraser.IsOn;
|
||||
}
|
||||
|
||||
private void LoadBrushAutoRestoreColor(string hex)
|
||||
@@ -213,7 +218,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchEnableInkFade_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableInkFade = CardEnableInkFade.IsOn;
|
||||
SettingsManager.Settings.Canvas.EnableInkFade = ToggleSwitchEnableInkFade.IsOn;
|
||||
ExpanderEnableInkFade.IsExpanded = ToggleSwitchEnableInkFade.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -234,7 +240,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchBrushAutoRestore_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableBrushAutoRestore = CardBrushAutoRestore.IsOn;
|
||||
SettingsManager.Settings.Canvas.EnableBrushAutoRestore = ToggleSwitchBrushAutoRestore.IsOn;
|
||||
ExpanderBrushAutoRestore.IsExpanded = ToggleSwitchBrushAutoRestore.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -273,7 +280,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchEnableEraserAutoSwitchBack_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableEraserAutoSwitchBack = CardEnableEraserAutoSwitchBack.IsOn;
|
||||
SettingsManager.Settings.Canvas.EnableEraserAutoSwitchBack = ToggleSwitchEnableEraserAutoSwitchBack.IsOn;
|
||||
ExpanderEnableEraserAutoSwitchBack.IsExpanded = ToggleSwitchEnableEraserAutoSwitchBack.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -301,7 +309,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchEnablePalmEraser_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnablePalmEraser = CardEnablePalmEraser.IsOn;
|
||||
SettingsManager.Settings.Canvas.EnablePalmEraser = ToggleSwitchEnablePalmEraser.IsOn;
|
||||
ExpanderEnablePalmEraser.IsExpanded = ToggleSwitchEnablePalmEraser.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="个性化" Description="个性化设置"
|
||||
IsClickEnabled="True" Click="QuickNavCard_Click" Tag="AppearancePage">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Personalize}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="其他" />
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
<ui:SettingsExpander x:Name="settingsCard" VerticalAlignment="Top"
|
||||
Description="The SettingsExpander has the same properties as a Card, and you can set SettingsCard as part of the Items collection."
|
||||
Header="SettingsExpander" IsEnabled="True"
|
||||
IsExpanded="True">
|
||||
IsExpanded="True"
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Glyph=""/>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<ui:SettingsExpander Header="形状修正"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableInkToShape, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardEnableInkToShape, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
@@ -97,19 +97,16 @@
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoStraightenLine"
|
||||
<ui:SettingsExpander x:Name="ExpanderAutoStraightenLine"
|
||||
Header="{i18n:I18n Key=InkRecog_AutoStraightLine}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.LineDisplay}"
|
||||
SwitchName="ToggleSwitchAutoStraightenLine"
|
||||
Toggled="ToggleSwitchAutoStraightenLine_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=InkRecog_AutoStraightLine}"
|
||||
Visibility="{Binding IsOn, ElementName=CardAutoStraightenLine, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardAutoStraightenLine, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.LineDisplay}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchAutoStraightenLine"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchAutoStraightenLine_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_LengthThreshold}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
@@ -138,19 +135,16 @@
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardLineEndpointSnapping"
|
||||
<ui:SettingsExpander x:Name="ExpanderLineEndpointSnapping"
|
||||
Header="{i18n:I18n Key=InkRecog_LineEndpointSnapping}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Link}"
|
||||
SwitchName="ToggleSwitchLineEndpointSnapping"
|
||||
Toggled="ToggleSwitchLineEndpointSnapping_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=InkRecog_LineEndpointSnapping}"
|
||||
Visibility="{Binding IsOn, ElementName=CardLineEndpointSnapping, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardLineEndpointSnapping, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Link}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:ToggleSwitch x:Name="ToggleSwitchLineEndpointSnapping"
|
||||
OnContent="{DynamicResource Common_On}"
|
||||
OffContent="{DynamicResource Common_Off}"
|
||||
Toggled="ToggleSwitchLineEndpointSnapping_Toggled" />
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_SnappingDistance}"
|
||||
Description="{i18n:I18n Key=InkRecog_LineEndpointSnappingHint}">
|
||||
|
||||
@@ -48,10 +48,10 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
if (settings.Canvas != null)
|
||||
{
|
||||
CardAutoStraightenLine.IsOn = settings.Canvas.AutoStraightenLine;
|
||||
ToggleSwitchAutoStraightenLine.IsOn = settings.Canvas.AutoStraightenLine;
|
||||
AutoStraightenLineThresholdSlider.Value = settings.Canvas.AutoStraightenLineThreshold;
|
||||
CheckboxHighPrecisionLineStraighten.IsChecked = settings.Canvas.HighPrecisionLineStraighten;
|
||||
CardLineEndpointSnapping.IsOn = settings.Canvas.LineEndpointSnapping;
|
||||
ToggleSwitchLineEndpointSnapping.IsOn = settings.Canvas.LineEndpointSnapping;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -60,6 +60,9 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
}
|
||||
|
||||
_isLoaded = true;
|
||||
|
||||
ExpanderAutoStraightenLine.IsExpanded = ToggleSwitchAutoStraightenLine.IsOn;
|
||||
ExpanderLineEndpointSnapping.IsExpanded = ToggleSwitchLineEndpointSnapping.IsOn;
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableInkToShape_Toggled(object sender, RoutedEventArgs e)
|
||||
@@ -124,7 +127,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchAutoStraightenLine_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.AutoStraightenLine = CardAutoStraightenLine.IsOn;
|
||||
SettingsManager.Settings.Canvas.AutoStraightenLine = ToggleSwitchAutoStraightenLine.IsOn;
|
||||
ExpanderAutoStraightenLine.IsExpanded = ToggleSwitchAutoStraightenLine.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
@@ -152,7 +156,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
private void ToggleSwitchLineEndpointSnapping_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.LineEndpointSnapping = CardLineEndpointSnapping.IsOn;
|
||||
SettingsManager.Settings.Canvas.LineEndpointSnapping = ToggleSwitchLineEndpointSnapping.IsOn;
|
||||
ExpanderLineEndpointSnapping.IsExpanded = ToggleSwitchLineEndpointSnapping.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
Text="{i18n:I18n Key=About_PrivacyAndTelemetry}" />
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=About_PrivacyAndTelemetry}"
|
||||
IsExpanded="True">
|
||||
IsExpanded="True"
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Shield}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
|
||||
@@ -89,14 +89,11 @@
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Warning}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<RadioButton x:Name="RadioCrashSilentRestart" GroupName="CrashAction"
|
||||
Content="{i18n:I18n Key=Crash_SilentRestart}"
|
||||
Checked="RadioCrashAction_Checked" />
|
||||
<RadioButton x:Name="RadioCrashNoAction" GroupName="CrashAction"
|
||||
Content="{i18n:I18n Key=Crash_NoAction}"
|
||||
Checked="RadioCrashAction_Checked" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ComboBox x:Name="ComboBoxCrashAction"
|
||||
SelectionChanged="ComboBoxCrashAction_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Crash_SilentRestart}" Tag="0" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Crash_NoAction}" Tag="1" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<!-- 底部空白 -->
|
||||
|
||||
@@ -50,14 +50,7 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
CardEnableNibMode.IsOn = settings.Startup.IsEnableNibMode;
|
||||
|
||||
if (settings.Startup.CrashAction == 0)
|
||||
{
|
||||
RadioCrashSilentRestart.IsChecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RadioCrashNoAction.IsChecked = true;
|
||||
}
|
||||
ComboBoxCrashAction.SelectedIndex = settings.Startup.CrashAction;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -203,21 +196,25 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
#region 崩溃后操作事件处理
|
||||
|
||||
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
|
||||
private void ComboBoxCrashAction_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
|
||||
var item = ComboBoxCrashAction?.SelectedItem as ComboBoxItem;
|
||||
if (item == null) return;
|
||||
var tag = item.Tag?.ToString() ?? "0";
|
||||
switch (tag)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.SilentRestart;
|
||||
SettingsManager.Settings.Startup.CrashAction = 0;
|
||||
}
|
||||
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
|
||||
{
|
||||
App.CrashAction = App.CrashActionType.NoAction;
|
||||
SettingsManager.Settings.Startup.CrashAction = 1;
|
||||
case "0":
|
||||
App.CrashAction = App.CrashActionType.SilentRestart;
|
||||
SettingsManager.Settings.Startup.CrashAction = 0;
|
||||
break;
|
||||
case "1":
|
||||
App.CrashAction = App.CrashActionType.NoAction;
|
||||
SettingsManager.Settings.Startup.CrashAction = 1;
|
||||
break;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
App.SyncCrashActionFromSettings();
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
Header="{i18n:I18n Key=Startup_SilentUpdateTimePeriod}"
|
||||
Visibility="{Binding IsOn, ElementName=CardSilentUpdate, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
IsExpanded="{Binding IsOn, ElementName=CardSilentUpdate, Mode=OneWay}"
|
||||
d:Visibility="Visible">
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
<ui:SettingsExpander x:Name="ExpanderAlwaysOnTop"
|
||||
Header="{i18n:I18n Key=Startup_TopMost}"
|
||||
Description="{i18n:I18n Key=Startup_TopMostHint}"
|
||||
IsExpanded="{Binding IsOn, ElementName=ToggleSwitchAlwaysOnTop, Mode=OneWay}">
|
||||
IsExpanded="{Binding IsOn, ElementName=ToggleSwitchAlwaysOnTop, Mode=OneWay}"
|
||||
d:Visibility="Visible" d:IsExpanded="True">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
|
||||
@@ -128,8 +128,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="BasicItem"
|
||||
Content="基本"
|
||||
Tag="StartupPage"
|
||||
SelectsOnInvoked="True"
|
||||
SelectsOnInvoked="False"
|
||||
ToolTipService.ToolTip="基本设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
@@ -160,7 +159,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="MainInterfaceItem"
|
||||
Content="主界面"
|
||||
Tag="WindowPage"
|
||||
SelectsOnInvoked="False"
|
||||
ToolTipService.ToolTip="主界面设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.TVMonitor}"/>
|
||||
@@ -175,6 +174,15 @@
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="AppearancePageItem"
|
||||
Content="个性化"
|
||||
Tag="AppearancePage"
|
||||
ToolTipService.ToolTip="个性化设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Personalize}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
@@ -204,8 +212,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="CanvasPageItem"
|
||||
Content="画板"
|
||||
Tag="CanvasPage"
|
||||
SelectsOnInvoked="True"
|
||||
SelectsOnInvoked="False"
|
||||
ToolTipService.ToolTip="画板与墨迹设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Edit}"/>
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{ "StartupPage", typeof(StartupPage) },
|
||||
{ "PrivacyPage", typeof(PrivacyPage) },
|
||||
{ "WindowPage", typeof(WindowPage) },
|
||||
{ "AppearancePage", typeof(AppearancePage) },
|
||||
{ "UpdatePage", typeof(UpdatePage) },
|
||||
{ "ExperimentalPage", typeof(ExperimentalPage) },
|
||||
{ "CanvasPage", typeof(CanvasPage) },
|
||||
|
||||
Reference in New Issue
Block a user