refactor:迁移设置
This commit is contained in:
+7
-754
@@ -656,216 +656,10 @@
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="6">
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchIsAutoUpdate" Label="{i18n:I18n Key=Header_AutoUpdate}" IsOn="True" Toggled="ToggleSwitchIsAutoUpdate_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchIsAutoUpdateWithSilence" Label="{i18n:I18n Key=Header_SilentUpdate}" IsOn="True" Toggled="ToggleSwitchIsAutoUpdateWithSilence_Toggled"
|
||||
Hint="{i18n:I18n Key=Startup_SilentUpdateHint}" ShowWhen="{Binding IsOn, ElementName=ToggleSwitchIsAutoUpdate}"/>
|
||||
|
||||
<!-- 更新包架构 -->
|
||||
<ikw:SimpleStackPanel Spacing="8" Margin="0,8,0,0">
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_UpdatePackageArchitecture}" FontSize="15" FontWeight="Bold" Foreground="#fafafa"/>
|
||||
<ui:RadioButtons x:Name="UpdatePackageArchitectureSelector" Margin="0,4,0,0">
|
||||
<RadioButton Content="{i18n:I18n Key=Update_PackageArch_X86}" GroupName="UpdatePackageArchitecture"
|
||||
Tag="X86" Checked="UpdatePackageArchitectureSelector_Checked"/>
|
||||
<RadioButton Content="{i18n:I18n Key=Update_PackageArch_X64}" GroupName="UpdatePackageArchitecture"
|
||||
Tag="X64" Checked="UpdatePackageArchitectureSelector_Checked"/>
|
||||
</ui:RadioButtons>
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_UpdatePackageArchitectureHint}" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 更新通道选择 -->
|
||||
<ikw:SimpleStackPanel Spacing="8" Margin="0,8,0,0">
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_UpdateChannel}" FontSize="15" FontWeight="Bold" Foreground="#fafafa"/>
|
||||
<ui:RadioButtons x:Name="UpdateChannelSelector" Margin="0,4,0,0">
|
||||
<RadioButton Content="{i18n:I18n Key=Update_Release}" GroupName="UpdateChannel"
|
||||
Tag="Release" Checked="UpdateChannelSelector_Checked"/>
|
||||
<RadioButton Content="{i18n:I18n Key=Update_Preview}" GroupName="UpdateChannel"
|
||||
Tag="Preview" Checked="UpdateChannelSelector_Checked"/>
|
||||
<RadioButton Content="{i18n:I18n Key=Update_Beta}" GroupName="UpdateChannel"
|
||||
Tag="Beta" Checked="UpdateChannelSelector_Checked"/>
|
||||
</ui:RadioButtons>
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_UpdateChannelHint}" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 手动更新按钮 -->
|
||||
<Button x:Name="ManualUpdateButton" Content="{i18n:I18n Key=Btn_ManualUpdate}" Margin="0,8,0,0"
|
||||
Width="220" HorizontalAlignment="Left" Click="ManualUpdateButton_Click"
|
||||
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdate, Path=IsOn, Converter={StaticResource InverseBooleanToVisibilityConverter}}"/>
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_ManualUpdateHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa"
|
||||
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdate, Path=IsOn, Converter={StaticResource InverseBooleanToVisibilityConverter}}"/>
|
||||
<!-- 版本修复按钮 -->
|
||||
<Button x:Name="FixVersionButton" Content="{i18n:I18n Key=Btn_FixVersion}" Margin="0,8,0,0"
|
||||
Width="220" HorizontalAlignment="Left" Click="FixVersionButton_Click"/>
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_FixVersionHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<Button x:Name="HistoryRollbackButton" Content="{i18n:I18n Key=Btn_HistoryRollback}" Width="220" Margin="0,10,0,0" Click="HistoryRollbackButton_Click"/>
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_HistoryRollbackHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<Border BorderBrush="White" BorderThickness="1" CornerRadius="5" Padding="12"
|
||||
Visibility="{Binding ElementName=ToggleSwitchIsAutoUpdateWithSilence, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ikw:SimpleStackPanel Spacing="12">
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=Startup_SilentUpdateFullHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<ikw:SimpleStackPanel x:Name="AutoUpdateTimePeriodBlock" Spacing="12">
|
||||
<ikw:SimpleStackPanel Spacing="12">
|
||||
<TextBlock Text="{i18n:I18n Key=Startup_SilentUpdateTimePeriod}" FontSize="15" FontWeight="Bold"
|
||||
TextWrapping="Wrap" Foreground="#fafafa" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
|
||||
Text="{i18n:I18n Key=Startup_StartTime}" FontSize="14" TextWrapping="Wrap"
|
||||
Foreground="#fafafa" />
|
||||
<ComboBox x:Name="AutoUpdateWithSilenceStartTimeComboBox"
|
||||
Width="90"
|
||||
SelectionChanged="AutoUpdateWithSilenceStartTimeComboBox_SelectionChanged" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
|
||||
Text="{i18n:I18n Key=Startup_EndTime}" FontSize="14" TextWrapping="Wrap"
|
||||
Foreground="#fafafa" />
|
||||
<ComboBox x:Name="AutoUpdateWithSilenceEndTimeComboBox"
|
||||
Width="90"
|
||||
SelectionChanged="AutoUpdateWithSilenceEndTimeComboBox_SelectionChanged" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Width="340" HorizontalAlignment="Left"
|
||||
Text="{i18n:I18n Key=Startup_TimePeriodHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Border>
|
||||
<!--<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchAutoHideCanvas" Header="自动隐藏画板" Toggled="ToggleSwitchAutoHideCanvas_Toggled"/>
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchAutoEnterModeFinger" Header="自动进入手指模式" Toggled="ToggleSwitchAutoEnterModeFinger_Toggled"/>-->
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxCanvas">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Canvas_GroupTitle}" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="6">
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchShowCursor" Label="{i18n:I18n Key=Canvas_ShowCursor}" IsOn="True" Toggled="ToggleSwitchShowCursor_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnablePressureTouchMode" Label="{i18n:I18n Key=Canvas_EnablePressureTouch}" Hint="{i18n:I18n Key=Canvas_EnablePressureTouchHint}" IsOn="True" Toggled="ToggleSwitchEnablePressureTouchMode_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchDisablePressure" Label="{i18n:I18n Key=Canvas_DisablePressure}" Hint="{i18n:I18n Key=Canvas_DisablePressureHint}" IsOn="True" Toggled="ToggleSwitchDisablePressure_Toggled"/>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_EraserSize}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxEraserSize"
|
||||
SelectedIndex="2"
|
||||
SelectionChanged="ComboBoxEraserSize_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_VerySmall}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Small}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Medium}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Large}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_VeryLarge}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Canvas_EraserSizeHint}" 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="ToggleSwitchHideStrokeWhenSelecting" Label="{i18n:I18n Key=Canvas_HideStrokeWhenSelecting}" Hint="{i18n:I18n Key=Canvas_HideStrokeWhenSelectingHint}" IsOn="True" Toggled="ToggleSwitchHideStrokeWhenSelecting_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchClearCanvasAndClearTimeMachine" Label="{i18n:I18n Key=Canvas_ClearInkAlsoClearHistory}" IsOn="True" Toggled="ToggleSwitchClearCanvasAndClearTimeMachine_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchClearCanvasAlsoClearImages" Label="{i18n:I18n Key=Canvas_ClearCanvasAlsoClearImages}" IsOn="False" Toggled="ToggleSwitchClearCanvasAlsoClearImages_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchCompressPicturesUploaded" Label="{i18n:I18n Key=Canvas_CompressPicturesUploaded}" IsOn="True" Toggled="ToggleSwitchCompressPicturesUploaded_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth" Label="{i18n:I18n Key=Canvas_LaunchSeewoVideoShowcaseForWhiteboardBooth}" Hint="{i18n:I18n Key=Canvas_LaunchSeewoVideoShowcaseForWhiteboardBoothHint}" IsOn="False" Toggled="ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth_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 Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_KeepHyperbolaAsymptote}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxHyperbolaAsymptoteOption"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxHyperbolaAsymptoteOption_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Yes}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_No}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_AskEachTime}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Canvas_HyperbolaAsymptoteHint}" TextWrapping="Wrap"
|
||||
Foreground="#a1a1aa" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchShowCircleCenter" Label="{i18n:I18n Key=Canvas_ShowCircleCenter}" IsOn="True" Toggled="ToggleSwitchShowCircleCenter_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchFitToCurve" Label="{i18n:I18n Key=Canvas_WPFBezierSmoothing}" IsOn="False" Toggled="ToggleSwitchFitToCurve_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchAdvancedBezierSmoothing" Label="{i18n:I18n Key=Canvas_AdvancedBezierSmoothing}" IsOn="True" Toggled="ToggleSwitchAdvancedBezierSmoothing_Toggled"/>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableInkFade" Label="{i18n:I18n Key=Canvas_EnableInkFade}" Hint="{i18n:I18n Key=Canvas_EnableInkFadeHint}" IsOn="False" Toggled="ToggleSwitchEnableInkFade_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnableInkFade, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_InkFadeTime}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider Name="InkFadeTimeSlider" Width="150" Minimum="1000" Maximum="10000"
|
||||
Value="3000" TickFrequency="1000" IsSnapToTickEnabled="True"
|
||||
ValueChanged="InkFadeTimeSlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=InkFadeTimeSlider, Path=Value, StringFormat={}{0:0}ms}"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
|
||||
</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="ToggleSwitchHideInkFadeControlInPenMenu" Label="{i18n:I18n Key=Canvas_HideInkFadeInPenMenu}" Hint="{i18n:I18n Key=Canvas_HideInkFadeInPenMenuHint}" IsOn="False" Toggled="ToggleSwitchHideInkFadeControlInPenMenu_Toggled"/>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchBrushAutoRestore" Label="{i18n:I18n Key=Canvas_BrushAutoRestore}" Hint="{i18n:I18n Key=Canvas_BrushAutoRestoreHint}" IsOn="False" Toggled="ToggleSwitchBrushAutoRestore_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Left"
|
||||
Spacing="4"
|
||||
Visibility="{Binding ElementName=ToggleSwitchBrushAutoRestore, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_AutoRestoreTimePoints}"
|
||||
FontSize="14" Margin="0,0,0,0" />
|
||||
<TextBox Name="BrushAutoRestoreTimesTextBox" Width="260"
|
||||
TextChanged="BrushAutoRestoreTimesTextBox_TextChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_RestoreColor}" FontSize="14" Margin="0,8,0,0" />
|
||||
<ComboBox Name="ComboBoxBrushAutoRestoreColor" Width="260"
|
||||
SelectionChanged="ComboBoxBrushAutoRestoreColor_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Default}" Tag="#FFFF0000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Black}" Tag="#FF000000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_White}" Tag="#FFFFFFFF" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Red}" Tag="#FFFF0000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Yellow}" Tag="#FFFFFF00" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Blue}" Tag="#FF2563EB" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Green}" Tag="#FF16A34A" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Orange}" Tag="#FFFB9650" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Purple}" Tag="#FF9333EA" />
|
||||
</ComboBox>
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_RestoreWidth}" FontSize="14" Margin="0,8,0,0" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Slider Name="BrushAutoRestoreWidthSlider" Width="200" Minimum="1" Maximum="20"
|
||||
TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
Value="5"
|
||||
ValueChanged="BrushAutoRestoreWidthSlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa"
|
||||
Text="{Binding ElementName=BrushAutoRestoreWidthSlider, Path=Value, StringFormat={}{0:0}px}"
|
||||
FontSize="12" Margin="12,0,0,0" VerticalAlignment="Center" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_RestoreOpacity}" FontSize="14" Margin="0,8,0,0" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Slider Name="BrushAutoRestoreAlphaSlider" Width="200" Minimum="0" Maximum="255"
|
||||
TickFrequency="5" IsSnapToTickEnabled="True"
|
||||
ValueChanged="BrushAutoRestoreAlphaSlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa"
|
||||
Text="{Binding ElementName=BrushAutoRestoreAlphaSlider, Path=Value, StringFormat={}{0:0}}"
|
||||
FontSize="12" Margin="12,0,0,0" VerticalAlignment="Center" />
|
||||
</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="ToggleSwitchEnableEraserAutoSwitchBack" Label="{i18n:I18n Key=Canvas_SwitchBackAfterEraser}" Hint="{i18n:I18n Key=Canvas_SwitchBackAfterEraserHint}" IsOn="False" Toggled="ToggleSwitchEnableEraserAutoSwitchBack_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnableEraserAutoSwitchBack, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Canvas_SwitchBackDelay}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider Name="EraserAutoSwitchBackDelaySlider" Width="150" Minimum="1" Maximum="60"
|
||||
Value="10" TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
ValueChanged="EraserAutoSwitchBackDelaySlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=EraserAutoSwitchBackDelaySlider, Path=Value, StringFormat={}{0:0}秒}"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Canvas_SwitchBackDelayHint}" TextWrapping="Wrap" Foreground="#a1a1aa"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnableEraserAutoSwitchBack, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<!-- 崩溃后操作设置 -->
|
||||
<GroupBox Name="GroupBoxCrashAction">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Crash_Title}" FontWeight="Bold" Foreground="#fafafa"
|
||||
@@ -882,7 +676,7 @@
|
||||
Checked="RadioCrashAction_Checked"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Crash_Hint}" Foreground="#a1a1aa" TextWrapping="Wrap" Width="420" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxGesture">
|
||||
<GroupBox.Header>
|
||||
@@ -896,9 +690,9 @@
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableTwoFingerRotationOnSelection" Label="{i18n:I18n Key=Gesture_AllowRotateScale}" Hint="{i18n:I18n Key=Gesture_AllowRotateScaleHint}" IsOn="True" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled"/>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnablePalmEraser" Label="{i18n:I18n Key=Gesture_EnablePalmEraser}" Hint="{i18n:I18n Key=Gesture_PalmHint}" IsOn="False" Toggled="ToggleSwitchEnablePalmEraser_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnablePalmEraser" Label="{i18n:I18n Key=Gesture_EnablePalmEraser}" Hint="{i18n:I18n Key=Gesture_PalmHint}" IsOn="False" Toggled="ToggleSwitchEnablePalmEraser_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnablePalmEraser, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnablePalmEraser, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=Gesture_PalmSensitivity}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxPalmEraserSensitivity" Width="120" SelectionChanged="ComboBoxPalmEraserSensitivity_SelectionChanged">
|
||||
@@ -906,112 +700,11 @@
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Gesture_PalmSensitivityMedium}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Gesture_PalmSensitivityHigh}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Gesture_PalmHint}"
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=Gesture_PalmHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnablePalmEraser, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxInkRecognition">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=InkRecog_Title}" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="6">
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableInkToShape" Label="{i18n:I18n Key=InkRecog_EnableInkRecognition}" IsOn="True" Toggled="ToggleSwitchEnableInkToShape_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_ShapeEngine}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxShapeRecognitionEngine" Width="160"
|
||||
SelectionChanged="ComboBoxShapeRecognitionEngine_SelectionChanged"
|
||||
VerticalAlignment="Center">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineAuto}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineIACore}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineWinRT}" />
|
||||
</ComboBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=InkRecog_ShapeEngineHint}" TextWrapping="Wrap"
|
||||
Foreground="#a1a1aa" MaxWidth="520" HorizontalAlignment="Left" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableWinRtHandwritingStrokeBeautify" Label="{i18n:I18n Key=InkRecog_HandwritingBeautify}" Hint="{i18n:I18n Key=InkRecog_HandwritingBeautifyHint}" IsOn="False" Toggled="ToggleSwitchEnableWinRtHandwritingStrokeBeautify_Toggled"/>
|
||||
<ikw:SimpleStackPanel Spacing="6"
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnableInkToShape, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableInkToShapeNoFakePressureRectangle" Label="{i18n:I18n Key=InkRecog_BlockRectFakePressure}" IsOn="True" Toggled="ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled"/>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchEnableInkToShapeNoFakePressureTriangle" Label="{i18n:I18n Key=InkRecog_BlockTriFakePressure}" IsOn="True" Toggled="ToggleSwitchEnableInkToShapeNoFakePressureTriangle_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">
|
||||
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeTriangle"
|
||||
Checked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged">
|
||||
<CheckBox.Content>
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_FixTriangle}"
|
||||
VerticalAlignment="Center" FontSize="14"
|
||||
Margin="0,0,16,0" />
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeRectangle"
|
||||
Checked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged">
|
||||
<CheckBox.Content>
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_FixRectangle}"
|
||||
VerticalAlignment="Center" FontSize="14"
|
||||
Margin="0,0,16,0" />
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeRounded"
|
||||
Checked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged">
|
||||
<CheckBox.Content>
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_FixEllipse}"
|
||||
VerticalAlignment="Center" FontSize="14"
|
||||
Margin="0,0,16,0" />
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
</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="ToggleSwitchAutoStraightenLine" Label="{i18n:I18n Key=InkRecog_AutoStraightLine}" IsOn="True" Toggled="ToggleSwitchAutoStraightenLine_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchAutoStraightenLine, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_LengthThreshold}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider Name="AutoStraightenLineThresholdSlider" Width="150" Minimum="30" Maximum="300"
|
||||
Value="80" TickFrequency="30" IsSnapToTickEnabled="True"
|
||||
ValueChanged="AutoStraightenLineThresholdSlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=AutoStraightenLineThresholdSlider, Path=Value, StringFormat={}{0:0}}"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchAutoStraightenLine, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_Sensitivity}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider Name="LineStraightenSensitivitySlider" Width="150" Minimum="0.05" Maximum="2.0"
|
||||
Value="0.20" TickFrequency="0.05" IsSnapToTickEnabled="True"
|
||||
ValueChanged="LineStraightenSensitivitySlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=LineStraightenSensitivitySlider, Path=Value, StringFormat={}{0:F2}}"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchHighPrecisionLineStraighten" Label="{i18n:I18n Key=InkRecog_HighPrecisionStraighten}" Hint="{i18n:I18n Key=InkRecog_HighPrecisionHint}" IsOn="True" ShowWhen="{Binding IsOn, ElementName=ToggleSwitchAutoStraightenLine}" Toggled="ToggleSwitchHighPrecisionLineStraighten_Toggled"/>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
|
||||
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<controls:LabeledToggleSwitch x:Name="ToggleSwitchLineEndpointSnapping" Label="{i18n:I18n Key=InkRecog_LineEndpointSnapping}" IsOn="True" Toggled="ToggleSwitchLineEndpointSnapping_Toggled"/>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"
|
||||
Visibility="{Binding ElementName=ToggleSwitchLineEndpointSnapping, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<TextBlock Foreground="#fafafa" Text="{i18n:I18n Key=InkRecog_SnappingDistance}" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<Slider Name="LineEndpointSnappingThresholdSlider" Width="150" Minimum="5" Maximum="50"
|
||||
Value="15" TickFrequency="5" IsSnapToTickEnabled="True"
|
||||
ValueChanged="LineEndpointSnappingThresholdSlider_ValueChanged" />
|
||||
<TextBlock Foreground="#fafafa" Text="{Binding ElementName=LineEndpointSnappingThresholdSlider, Path=Value, StringFormat={}{0:0}}"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="16,0,0,0" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock Text="{i18n:I18n Key=InkRecog_LineEndpointSnappingHint}" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ikw:SimpleStackPanel>
|
||||
Visibility="{Binding ElementName=ToggleSwitchEnablePalmEraser, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxAppearanceNewUI">
|
||||
<GroupBox.Header>
|
||||
@@ -3447,446 +3140,6 @@
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxAbout">
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=About_Title}" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ikw:SimpleStackPanel Spacing="12">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock FontSize="18" FontWeight="Bold" Text="{i18n:I18n Key=About_VersionLabel}" />
|
||||
<TextBlock x:Name="AppVersionTextBlock" FontSize="18" FontWeight="Bold"
|
||||
Text="1.X.X.X" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<!-- 设备信息 -->
|
||||
<Border BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="8"
|
||||
Background="#18181b" Padding="12">
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock Text="{i18n:I18n Key=About_DeviceInfo}" FontWeight="Bold" Foreground="#fafafa" FontSize="14" />
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{i18n:I18n Key=About_DeviceIdLabel}" Foreground="#a1a1aa" FontSize="12" />
|
||||
<TextBlock x:Name="DeviceIdTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" Foreground="#fafafa" FontSize="12" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{i18n:I18n Key=About_UsageFrequencyLabel}" Foreground="#a1a1aa" FontSize="12" />
|
||||
<TextBlock x:Name="UsageFrequencyTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" Foreground="#fafafa" FontSize="12" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{i18n:I18n Key=About_UpdatePriorityLabel}" Foreground="#a1a1aa" FontSize="12" />
|
||||
<TextBlock x:Name="UpdatePriorityTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" Foreground="#fafafa" FontSize="12" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{i18n:I18n Key=About_LaunchCountLabel}" Foreground="#a1a1aa" FontSize="12" />
|
||||
<TextBlock x:Name="LaunchCountTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" Foreground="#fafafa" FontSize="12" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{i18n:I18n Key=About_TotalUsageLabel}" Foreground="#a1a1aa" FontSize="12" />
|
||||
<TextBlock x:Name="TotalUsageTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" Foreground="#fafafa" FontSize="12" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<Button x:Name="RefreshDeviceInfoButton" Content="{i18n:I18n Key=About_RefreshDeviceInfo}"
|
||||
Width="120" Height="30" Margin="0,8,0,0"
|
||||
Click="RefreshDeviceInfo_Click" />
|
||||
|
||||
<Line X1="0" Y1="0" X2="460" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,6,0,6" />
|
||||
|
||||
<CheckBox x:Name="CheckBoxTelemetryPrivacyAccepted"
|
||||
Margin="0,0,0,2"
|
||||
Foreground="#a1a1aa"
|
||||
FontSize="12"
|
||||
Checked="CheckBoxTelemetryPrivacyAccepted_Checked"
|
||||
Unchecked="CheckBoxTelemetryPrivacyAccepted_Checked">
|
||||
<TextBlock Width="430" TextWrapping="Wrap">
|
||||
<Run Text="{i18n:I18n Key=About_PrivacyCheckboxPrefix}" />
|
||||
<Run Text="privacy" FontWeight="Bold" />
|
||||
<Run Text="{i18n:I18n Key=About_PrivacyCheckboxSuffix}" />
|
||||
</TextBlock>
|
||||
</CheckBox>
|
||||
|
||||
<Grid Width="420" HorizontalAlignment="Left" Margin="0,2,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{i18n:I18n Key=About_TelemetryLabel}"
|
||||
Foreground="#a1a1aa"
|
||||
FontSize="12"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
<ComboBox Grid.Column="1"
|
||||
x:Name="ComboBoxTelemetryUploadLevel"
|
||||
Margin="8,0,0,0"
|
||||
Width="225"
|
||||
HorizontalAlignment="Left"
|
||||
SelectionChanged="ComboBoxTelemetryUploadLevel_SelectionChanged">
|
||||
<ComboBoxItem Tag="0" Content="{i18n:I18n Key=About_Telemetry_Off}" />
|
||||
<ComboBoxItem Tag="1" Content="{i18n:I18n Key=About_Telemetry_Basic}" />
|
||||
<ComboBoxItem Tag="2" Content="{i18n:I18n Key=About_Telemetry_Optional}" />
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Border>
|
||||
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=About_LicenseHint}"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<Border BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="8"
|
||||
Background="#18181b">
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" Margin="8">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<Image Width="32" Height="32" VerticalAlignment="Top">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="F0 M24,24z M0,0z M12.875,3C12.875,2.51675 12.4832,2.125 12,2.125 11.5168,2.125 11.125,2.51675 11.125,3L11.125,4.25876 5.86249,5.13585C5.84299,5.13895 5.82367,5.1427 5.80454,5.14708 5.62042,5.1891 5.46195,5.28735 5.34446,5.4204 5.31167,5.45747 5.28185,5.49755 5.25544,5.54036 5.23979,5.56568 5.22542,5.59181 5.2124,5.61865L2.21738,11.6087C2.15663,11.7302 2.125,11.8642 2.125,12 2.125,13.0277 2.53326,14.0133 3.25996,14.74 3.98667,15.4667 4.97229,15.875 6,15.875 7.02771,15.875 8.01334,15.4667 8.74004,14.74 9.46674,14.0133 9.875,13.0277 9.875,12 9.875,11.8642 9.84337,11.7302 9.78262,11.6087L7.31244,6.66833 11.125,6.0329 11.125,19.125 7,19.125C6.51675,19.125 6.125,19.5168 6.125,20 6.125,20.4832 6.51675,20.875 7,20.875L17,20.875C17.4832,20.875 17.875,20.4832 17.875,20 17.875,19.5168 17.4832,19.125 17,19.125L12.875,19.125 12.875,6.0329 16.6876,6.66833 14.2174,11.6087C14.1566,11.7302 14.125,11.8642 14.125,12 14.125,13.0277 14.5333,14.0133 15.26,14.74 15.9867,15.4667 16.9723,15.875 18,15.875 19.0277,15.875 20.0133,15.4667 20.74,14.74 21.4667,14.0133 21.875,13.0277 21.875,12 21.875,11.8642 21.8434,11.7302 21.7826,11.6087L18.7876,5.61864C18.7746,5.5918 18.7602,5.56567 18.7446,5.54036 18.7182,5.49755 18.6883,5.45747 18.6555,5.4204 18.538,5.28735 18.3796,5.1891 18.1955,5.14708 18.1763,5.1427 18.157,5.13895 18.1375,5.13585L12.875,4.25876 12.875,3z M3.88347,12.1896C3.92772,12.6837 4.14382,13.149 4.4974,13.5026 4.89591,13.9011 5.43641,14.125 6,14.125 6.56359,14.125 7.10409,13.9011 7.5026,13.5026 7.85618,13.149 8.07228,12.6837 8.11653,12.1896L6,7.95656 3.88347,12.1896z M16.4974,13.5026C16.1438,13.149,15.9277,12.6837,15.8835,12.1896L18,7.95656 20.1165,12.1896C20.0723,12.6837 19.8562,13.149 19.5026,13.5026 19.1041,13.9011 18.5636,14.125 18,14.125 17.4364,14.125 16.8959,13.9011 16.4974,13.5026z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<StackPanel Orientation="Vertical" Margin="4,0,0,0">
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=About_LicenseTitle}" Margin="0,0,0,-1"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" FontWeight="Bold" />
|
||||
<TextBlock
|
||||
Text="GNU General Public License v3.0" FontSize="20"
|
||||
TextWrapping="Wrap" Foreground="White" />
|
||||
</StackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=About_LicenseBody}"
|
||||
Margin="0,2,0,1" TextWrapping="Wrap" Foreground="#a1a1aa" FontSize="11" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</Border>
|
||||
<TextBlock FontSize="18" FontWeight="Bold" Margin="0,0,0,4" Text="{i18n:I18n Key=About_DevelopersLabel}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/CJKmkp.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="128"
|
||||
Margin="0,0,0,6" Height="128">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="64,64" RadiusX="64" RadiusY="64" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="18" Foreground="#fde047"
|
||||
FontWeight="Bold">
|
||||
CJK_mkp
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="12" Foreground="White" Text="{i18n:I18n Key=About_Dev_ICCCE}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="1" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/dubi906w.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="128"
|
||||
Margin="0,0,0,6" Height="128">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="64,64" RadiusX="64" RadiusY="64" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="18" Foreground="#fde047"
|
||||
FontWeight="Bold">
|
||||
Dubi906w
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="12" Foreground="White" Text="{i18n:I18n Key=About_Dev_ICC}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="1" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/ChangSakura.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="128"
|
||||
Margin="0,0,0,6" Height="128">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="64,64" RadiusX="64" RadiusY="64" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="18" Foreground="#fde047"
|
||||
FontWeight="Bold">
|
||||
ChangSakura
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="12" Foreground="White" Text="{i18n:I18n Key=About_Dev_ICA}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="1" Grid.Row="1" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/WXRIW.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="128"
|
||||
Margin="0,0,0,6" Height="128">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="64,64" RadiusX="64" RadiusY="64" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="18" Foreground="#fde047"
|
||||
FontWeight="Bold">
|
||||
WXRIW
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
FontSize="12" Foreground="White" Text="{i18n:I18n Key=About_Dev_InkCanvas}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<TextBlock FontSize="15">
|
||||
<Bold>
|
||||
<Run Text="{i18n:I18n Key=About_Source_ICC}" />
|
||||
</Bold>
|
||||
<Hyperlink Click="HyperlinkSourceToICCRepository_Click">
|
||||
<TextBlock Margin="2,0" Text="gitea:kriastans/InkCanvasForClass"
|
||||
TextWrapping="Wrap" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="15">
|
||||
<Bold>
|
||||
<Run Text="{i18n:I18n Key=About_Source_ICA}" />
|
||||
</Bold>
|
||||
<Hyperlink Click="HyperlinkSourceToPresentRepository_Click">
|
||||
<TextBlock Margin="2,0" Text="ChangSakura/Ink-Canvas" TextWrapping="Wrap" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="15">
|
||||
<Bold>
|
||||
<Run Text="{i18n:I18n Key=About_Source_InkCanvas}" />
|
||||
</Bold>
|
||||
<Hyperlink Click="HyperlinkSourceToOringinalRepository_Click">
|
||||
<TextBlock Margin="2,0" Text="WXRIW/Ink-Canvas" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<TextBlock FontSize="18" FontWeight="Bold" Margin="0,0,0,4" Text="{i18n:I18n Key=About_ThanksContributors}" />
|
||||
<Grid Margin="8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/RaspberryKan.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Raspberry Kan
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="1" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/kengwang.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Kengwang
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="2" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/jiajiaxd.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Charles Jia
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="3" Grid.Row="0" Orientation="Vertical">
|
||||
<Image Source="/Resources/DeveloperAvatars/clover-yan.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
clover_yan
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="1" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/NetheriteBowl.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Netherite_Bowl
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="1" Grid.Row="1" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/NotYoojun.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Yoojun Zhou
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="2" Grid.Row="1" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/yuwenhui2020.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
YuWenHui2020
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="3" Grid.Row="1" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/STBBRD.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
ZongziTEK
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="2" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/aaaaaaccd.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Aesthed
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="1" Grid.Row="2" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/wwei.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Wei
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="2" Grid.Row="2" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/Alan-CRL.png"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
Alan-CRL
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="3" Grid.Row="2" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/PrefacedCorg.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
PrefacedCorg
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Grid.Column="0" Grid.Row="3" Orientation="Vertical"
|
||||
Margin="0,16,0,0">
|
||||
<Image Source="/Resources/DeveloperAvatars/PANDA-JSR.jpg"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48"
|
||||
Margin="0,0,0,6" Height="48">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Margin="0,0,0,2" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="12" Foreground="White">
|
||||
PANDA-JSR
|
||||
</TextBlock>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
<ikw:SimpleStackPanel Spacing="3" Orientation="Vertical">
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=About_Copyright}" FontWeight="Bold"
|
||||
TextWrapping="Wrap" Foreground="White" />
|
||||
<TextBlock
|
||||
Text="{i18n:I18n Key=About_OpenSourceSlogan}" FontWeight="Bold"
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
</ikw:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ui:ScrollViewerEx>
|
||||
|
||||
|
||||
+35
-369
@@ -1183,7 +1183,6 @@ namespace Ink_Canvas
|
||||
LoadSettings(true);
|
||||
ApplyLanguageFromSettings();
|
||||
AutoBackupManager.Initialize(Settings);
|
||||
CheckUpdateChannelAndTelemetryConsistency();
|
||||
|
||||
// 初始化上传队列(恢复上次的上传队列)
|
||||
try
|
||||
@@ -1275,8 +1274,6 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
// HasNewUpdateWindow hasNewUpdateWindow = new HasNewUpdateWindow();
|
||||
if (Environment.Is64BitProcess) GroupBoxInkRecognition.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 根据设置应用主题
|
||||
switch (Settings.Appearance.Theme)
|
||||
{
|
||||
@@ -1380,16 +1377,6 @@ namespace Ink_Canvas
|
||||
ApplyUIAccessTopMost();
|
||||
}
|
||||
|
||||
// 初始化橡皮擦自动切换回批注模式开关
|
||||
if (ToggleSwitchEnableEraserAutoSwitchBack != null)
|
||||
{
|
||||
ToggleSwitchEnableEraserAutoSwitchBack.IsOn = Settings.Canvas.EnableEraserAutoSwitchBack;
|
||||
}
|
||||
if (EraserAutoSwitchBackDelaySlider != null)
|
||||
{
|
||||
EraserAutoSwitchBackDelaySlider.Value = Settings.Canvas.EraserAutoSwitchBackDelaySeconds;
|
||||
}
|
||||
|
||||
// 初始化剪贴板监控
|
||||
InitializeClipboardMonitoring();
|
||||
|
||||
@@ -1875,7 +1862,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
// 使用多线路组下载更新
|
||||
private async Task<bool> DownloadUpdateWithFallback(string version, AutoUpdateHelper.UpdateLineGroup primaryGroup, UpdateChannel channel)
|
||||
internal async Task<bool> DownloadUpdateWithFallback(string version, AutoUpdateHelper.UpdateLineGroup primaryGroup, UpdateChannel channel)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1905,7 +1892,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
private async void AutoUpdate()
|
||||
public async void AutoUpdate()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Settings.Startup.AutoUpdatePauseUntilDate))
|
||||
{
|
||||
@@ -2366,10 +2353,7 @@ namespace Ink_Canvas
|
||||
|
||||
private void NavAbout_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 切换到关于页面
|
||||
ShowSettingsSection("about");
|
||||
// 刷新设备信息
|
||||
RefreshDeviceInfo();
|
||||
}
|
||||
|
||||
// 个性化设置
|
||||
@@ -2394,88 +2378,6 @@ namespace Ink_Canvas
|
||||
BorderSettingsMask.Background = null; // 确保清除蒙层背景
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新设备信息按钮点击事件
|
||||
/// </summary>
|
||||
private void RefreshDeviceInfo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RefreshDeviceInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新设备信息显示
|
||||
/// </summary>
|
||||
private void RefreshDeviceInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 获取设备ID
|
||||
string deviceId = DeviceIdentifier.GetDeviceId();
|
||||
DeviceIdTextBlock.Text = deviceId;
|
||||
|
||||
// 获取使用频率
|
||||
var usageFrequency = DeviceIdentifier.GetUsageFrequency();
|
||||
string frequencyText;
|
||||
switch (usageFrequency)
|
||||
{
|
||||
case DeviceIdentifier.UsageFrequency.High:
|
||||
frequencyText = "高频用户";
|
||||
break;
|
||||
case DeviceIdentifier.UsageFrequency.Medium:
|
||||
frequencyText = "中频用户";
|
||||
break;
|
||||
case DeviceIdentifier.UsageFrequency.Low:
|
||||
frequencyText = "低频用户";
|
||||
break;
|
||||
default:
|
||||
frequencyText = "未知";
|
||||
break;
|
||||
}
|
||||
UsageFrequencyTextBlock.Text = frequencyText;
|
||||
|
||||
// 获取更新优先级
|
||||
var updatePriority = DeviceIdentifier.GetUpdatePriority();
|
||||
string priorityText;
|
||||
switch (updatePriority)
|
||||
{
|
||||
case DeviceIdentifier.UpdatePriority.High:
|
||||
priorityText = "高优先级(优先推送更新)";
|
||||
break;
|
||||
case DeviceIdentifier.UpdatePriority.Medium:
|
||||
priorityText = "中优先级(正常推送更新)";
|
||||
break;
|
||||
case DeviceIdentifier.UpdatePriority.Low:
|
||||
priorityText = "低优先级(延迟推送更新)";
|
||||
break;
|
||||
default:
|
||||
priorityText = "未知";
|
||||
break;
|
||||
}
|
||||
UpdatePriorityTextBlock.Text = priorityText;
|
||||
|
||||
// 获取使用统计(秒级精度)
|
||||
var (launchCount, totalSeconds, avgSessionSeconds, _) = DeviceIdentifier.GetUsageStats();
|
||||
LaunchCountTextBlock.Text = launchCount.ToString();
|
||||
|
||||
// 使用新的格式化方法显示秒级精度的使用时长
|
||||
string totalUsageText = DeviceIdentifier.FormatDuration(totalSeconds);
|
||||
TotalUsageTextBlock.Text = totalUsageText;
|
||||
|
||||
LogHelper.WriteLogToFile($"MainWindow | 设备信息已刷新 - ID: {deviceId}, 频率: {frequencyText}, 优先级: {priorityText}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"MainWindow | 刷新设备信息失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
|
||||
// 显示错误信息
|
||||
DeviceIdTextBlock.Text = "获取失败";
|
||||
UsageFrequencyTextBlock.Text = "获取失败";
|
||||
UpdatePriorityTextBlock.Text = "获取失败";
|
||||
LaunchCountTextBlock.Text = "获取失败";
|
||||
TotalUsageTextBlock.Text = "获取失败";
|
||||
}
|
||||
}
|
||||
|
||||
// 折叠侧边栏
|
||||
private void CollapseNavSidebar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -2534,15 +2436,9 @@ namespace Ink_Canvas
|
||||
case "startup":
|
||||
targetGroupBox = GroupBoxStartup;
|
||||
break;
|
||||
case "canvas":
|
||||
targetGroupBox = GroupBoxCanvas;
|
||||
break;
|
||||
case "gesture":
|
||||
targetGroupBox = GroupBoxGesture;
|
||||
break;
|
||||
case "inkrecognition":
|
||||
targetGroupBox = GroupBoxInkRecognition;
|
||||
break;
|
||||
case "crashaction":
|
||||
targetGroupBox = GroupBoxCrashAction;
|
||||
break;
|
||||
@@ -2565,9 +2461,6 @@ namespace Ink_Canvas
|
||||
// 快捷键设置部分可能尚未实现
|
||||
targetGroupBox = null;
|
||||
break;
|
||||
case "about":
|
||||
targetGroupBox = GroupBoxAbout;
|
||||
break;
|
||||
default:
|
||||
// 默认滚动到顶部
|
||||
SettingsPanelScrollViewer.ScrollToTop();
|
||||
@@ -3181,29 +3074,40 @@ namespace Ink_Canvas
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 墨迹渐隐功能
|
||||
/// <summary>
|
||||
/// 墨迹渐隐开关切换事件处理
|
||||
/// </summary>
|
||||
private void ToggleSwitchEnableInkFade_Toggled(object sender, RoutedEventArgs e)
|
||||
|
||||
private void ToggleSwitchEnableInkToShape_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings.Canvas.EnableInkFade = ToggleSwitchEnableInkFade.IsOn;
|
||||
_inkFadeManager.IsEnabled = Settings.Canvas.EnableInkFade;
|
||||
var toggle = sender as ToggleSwitch;
|
||||
if (toggle == null) return;
|
||||
Settings.InkToShape.IsInkToShapeEnabled = toggle.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换墨迹纠正功能时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
// 同步批注子面板中的开关状态
|
||||
if (ToggleSwitchInkFadeInPanel != null)
|
||||
private void ToggleSwitchInkFadeInPanel_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var toggle = sender as ToggleSwitch;
|
||||
if (toggle == null) return;
|
||||
Settings.Canvas.EnableInkFade = toggle.IsOn;
|
||||
if (_inkFadeManager != null)
|
||||
{
|
||||
ToggleSwitchInkFadeInPanel.IsOn = Settings.Canvas.EnableInkFade;
|
||||
_inkFadeManager.IsEnabled = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
// 同步普通画笔面板中的开关状态
|
||||
if (ToggleSwitchInkFadeInPanel2 != null)
|
||||
{
|
||||
ToggleSwitchInkFadeInPanel2.IsOn = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -3211,259 +3115,29 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 墨迹渐隐时间滑块值改变事件处理
|
||||
/// </summary>
|
||||
private void InkFadeTimeSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings.Canvas.InkFadeTime = (int)e.NewValue;
|
||||
if (_inkFadeManager != null)
|
||||
{
|
||||
_inkFadeManager.UpdateFadeTime(Settings.Canvas.InkFadeTime);
|
||||
}
|
||||
LogHelper.WriteLogToFile($"墨迹渐隐时间已更新为 {Settings.Canvas.InkFadeTime}ms", LogHelper.LogType.Event);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新墨迹渐隐时间时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批注子面板中墨迹渐隐开关切换事件处理
|
||||
/// </summary>
|
||||
private void ToggleSwitchInkFadeInPanel_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings.Canvas.EnableInkFade = ToggleSwitchInkFadeInPanel.IsOn;
|
||||
_inkFadeManager.IsEnabled = Settings.Canvas.EnableInkFade;
|
||||
|
||||
// 同步设置面板中的开关状态
|
||||
if (ToggleSwitchEnableInkFade != null)
|
||||
{
|
||||
ToggleSwitchEnableInkFade.IsOn = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
// 同步普通画笔面板中的开关状态
|
||||
if (ToggleSwitchInkFadeInPanel2 != null)
|
||||
{
|
||||
ToggleSwitchInkFadeInPanel2.IsOn = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"批注子面板中切换墨迹渐隐功能时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在笔工具菜单中隐藏墨迹渐隐控制开关切换事件处理
|
||||
/// <summary>
|
||||
/// 切换“在笔工具菜单中隐藏墨迹渐隐控制开关”设置并立即应用该更改。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 当控件切换时,方法会更新 Settings.Canvas.HideInkFadeControlInPenMenu 的值、将设置写回配置文件、刷新墨迹渐隐控件的可见性,并记录事件日志或错误日志。
|
||||
/// </remarks>
|
||||
private void ToggleSwitchHideInkFadeControlInPenMenu_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isLoaded)
|
||||
{
|
||||
Settings.Canvas.HideInkFadeControlInPenMenu = ToggleSwitchHideInkFadeControlInPenMenu.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
// 立即更新墨迹渐隐控制开关的可见性
|
||||
UpdateInkFadeControlVisibility();
|
||||
|
||||
LogHelper.WriteLogToFile($"在笔工具菜单中隐藏墨迹渐隐控制开关已{(Settings.Canvas.HideInkFadeControlInPenMenu ? "启用" : "禁用")}", LogHelper.LogType.Event);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换在笔工具菜单中隐藏墨迹渐隐控制开关时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 橡皮擦自动切换回批注模式开关切换事件处理
|
||||
/// </summary>
|
||||
private void ToggleSwitchEnableEraserAutoSwitchBack_Toggled(object sender, RoutedEventArgs e)
|
||||
private void ComboBoxEraserSizeFloatingBar_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Canvas.EnableEraserAutoSwitchBack = ToggleSwitchEnableEraserAutoSwitchBack.IsOn;
|
||||
var comboBox = sender as System.Windows.Controls.ComboBox;
|
||||
if (comboBox == null) return;
|
||||
|
||||
Settings.Canvas.EraserSize = comboBox.SelectedIndex;
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 如果禁用,停止计时器
|
||||
if (!Settings.Canvas.EnableEraserAutoSwitchBack)
|
||||
if (comboBox.Name == "ComboBoxEraserSizeFloatingBar" && BoardComboBoxEraserSize != null)
|
||||
{
|
||||
StopEraserAutoSwitchBackTimer();
|
||||
BoardComboBoxEraserSize.SelectedIndex = comboBox.SelectedIndex;
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"橡皮擦自动切换回批注模式已{(Settings.Canvas.EnableEraserAutoSwitchBack ? "启用" : "禁用")}", LogHelper.LogType.Event);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换橡皮擦自动切换回批注模式时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 橡皮擦自动切换延迟时间滑块值改变事件处理
|
||||
/// </summary>
|
||||
private void EraserAutoSwitchBackDelaySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Canvas.EraserAutoSwitchBackDelaySeconds = (int)e.NewValue;
|
||||
SaveSettingsToFile();
|
||||
|
||||
// 如果计时器正在运行,重新启动以应用新的延迟时间
|
||||
if (_eraserAutoSwitchBackTimer != null && _eraserAutoSwitchBackTimer.IsEnabled)
|
||||
else if (comboBox.Name == "BoardComboBoxEraserSize" && ComboBoxEraserSizeFloatingBar != null)
|
||||
{
|
||||
StartEraserAutoSwitchBackTimer();
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"橡皮擦自动切换延迟时间已更新为 {Settings.Canvas.EraserAutoSwitchBackDelaySeconds} 秒", LogHelper.LogType.Event);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新橡皮擦自动切换延迟时间时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据开关状态启用或禁用画笔自动恢复:更新设置并保存,启用时初始化并安排恢复定时器,禁用时停止计时器。
|
||||
/// </summary>
|
||||
private void ToggleSwitchBrushAutoRestore_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Canvas.EnableBrushAutoRestore = ToggleSwitchBrushAutoRestore.IsOn;
|
||||
SaveSettingsToFile();
|
||||
|
||||
if (Settings.Canvas.EnableBrushAutoRestore)
|
||||
{
|
||||
InitBrushAutoRestoreTimer();
|
||||
ScheduleBrushAutoRestore();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_brushAutoRestoreTimer != null)
|
||||
{
|
||||
_brushAutoRestoreTimer.Stop();
|
||||
}
|
||||
ComboBoxEraserSizeFloatingBar.SelectedIndex = comboBox.SelectedIndex;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"切换画笔自动恢复功能时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当“画笔自动恢复次数”文本改变时更新并保存设置;若启用画笔自动恢复,则重新调度自动恢复定时器。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 在窗口未完成加载或 Settings.Canvas 为 null 时不执行任何操作;方法内部会捕获并记录异常,不向调用方抛出异常。
|
||||
/// </remarks>
|
||||
private void BrushAutoRestoreTimesTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
if (Settings?.Canvas == null) return;
|
||||
|
||||
Settings.Canvas.BrushAutoRestoreTimes = BrushAutoRestoreTimesTextBox.Text ?? string.Empty;
|
||||
SaveSettingsToFile();
|
||||
if (Settings.Canvas.EnableBrushAutoRestore)
|
||||
{
|
||||
ScheduleBrushAutoRestore();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"BrushAutoRestoreTimes: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 响应画笔自动恢复颜色下拉框的选择变更并将选中项保存为设置中的目标颜色。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 当窗口已加载且 Settings.Canvas 可用时,将选中 ComboBoxItem 的 Tag(十六进制颜色字符串)写入 Settings.Canvas.BrushAutoRestoreColor 并持久化到设置文件;若发生异常则记录错误日志。
|
||||
/// </remarks>
|
||||
private void ComboBoxBrushAutoRestoreColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
if (Settings?.Canvas == null) return;
|
||||
|
||||
if (ComboBoxBrushAutoRestoreColor.SelectedItem is ComboBoxItem item)
|
||||
{
|
||||
string hex = item.Tag as string ?? string.Empty;
|
||||
Settings.Canvas.BrushAutoRestoreColor = hex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新画笔自动恢复目标颜色时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将画笔自动恢复的目标粗细设置为滑块的新值并将更改保存到设置文件。
|
||||
/// </summary>
|
||||
/// <param name="sender">触发事件的滑块控件(通常为 BrushAutoRestoreWidthSlider)。</param>
|
||||
/// <param name="e">包含滑块的新值的事件参数;使用 <c>e.NewValue</c> 作为目标粗细。</param>
|
||||
/// <remarks>
|
||||
/// 如果窗口尚未完成加载或 Settings.Canvas 为 null,则不执行任何操作。
|
||||
/// </remarks>
|
||||
private void BrushAutoRestoreWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
if (Settings?.Canvas == null) return;
|
||||
|
||||
Settings.Canvas.BrushAutoRestoreWidth = e.NewValue;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新画笔自动恢复目标粗细时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 在画笔自动恢复透明度滑块的值发生变化时,将新的透明度值保存到 Settings.Canvas.BrushAutoRestoreAlpha 并持久化到设置文件。
|
||||
/// </summary>
|
||||
/// <param name="e">来自滑块的事件参数;使用 <c>e.NewValue</c> 的整数值作为新的透明度目标。</param>
|
||||
private void BrushAutoRestoreAlphaSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
if (Settings?.Canvas == null) return;
|
||||
|
||||
Settings.Canvas.BrushAutoRestoreAlpha = (int)e.NewValue;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新画笔自动恢复目标透明度时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
LogHelper.WriteLogToFile($"切换橡皮擦大小时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3684,8 +3358,6 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化文件关联状态显示
|
||||
@@ -3812,10 +3484,6 @@ namespace Ink_Canvas
|
||||
// 获取所有滑块控件并添加触摸支持
|
||||
var sliders = new List<Slider>
|
||||
{
|
||||
InkFadeTimeSlider,
|
||||
AutoStraightenLineThresholdSlider,
|
||||
LineStraightenSensitivitySlider,
|
||||
LineEndpointSnappingThresholdSlider,
|
||||
ViewboxFloatingBarScaleTransformValueSlider,
|
||||
ViewboxFloatingBarOpacityValueSlider,
|
||||
ViewboxFloatingBarOpacityInPPTValueSlider,
|
||||
@@ -3842,9 +3510,7 @@ namespace Ink_Canvas
|
||||
InkAlphaSlider,
|
||||
HighlighterWidthSlider,
|
||||
MLAvoidanceHistorySlider,
|
||||
MLAvoidanceWeightSlider,
|
||||
BrushAutoRestoreWidthSlider,
|
||||
BrushAutoRestoreAlphaSlider
|
||||
MLAvoidanceWeightSlider
|
||||
};
|
||||
|
||||
foreach (var slider in sliders)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,6 @@ namespace Ink_Canvas
|
||||
/// <param name="skipAutoUpdateCheck">指示是否跳过自动更新检查;为 true 时不会在加载设置后执行自动更新检测。</param>
|
||||
private void LoadSettings(bool isStartup = false, bool skipAutoUpdateCheck = false)
|
||||
{
|
||||
AppVersionTextBlock.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
try
|
||||
{
|
||||
if (File.Exists(App.RootPath + settingsFileName))
|
||||
@@ -184,32 +183,6 @@ namespace Ink_Canvas
|
||||
{
|
||||
if (Settings?.Startup != null)
|
||||
{
|
||||
if (ComboBoxTelemetryUploadLevel != null)
|
||||
{
|
||||
int idx = 0;
|
||||
switch (Settings.Startup.TelemetryUploadLevel)
|
||||
{
|
||||
case TelemetryUploadLevel.None:
|
||||
idx = 0;
|
||||
break;
|
||||
case TelemetryUploadLevel.Basic:
|
||||
idx = 1;
|
||||
break;
|
||||
case TelemetryUploadLevel.Extended:
|
||||
idx = 2;
|
||||
break;
|
||||
default:
|
||||
idx = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
ComboBoxTelemetryUploadLevel.SelectedIndex = idx;
|
||||
}
|
||||
|
||||
if (CheckBoxTelemetryPrivacyAccepted != null)
|
||||
{
|
||||
CheckBoxTelemetryPrivacyAccepted.IsChecked = Settings.Startup.HasAcceptedTelemetryPrivacy;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -241,9 +214,6 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
// 设置自动更新相关选项
|
||||
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
|
||||
|
||||
// 只有在启用了自动更新功能时才检查更新
|
||||
if (Settings.Startup.IsAutoUpdate && !skipAutoUpdateCheck)
|
||||
{
|
||||
if (isStartup)
|
||||
@@ -251,63 +221,12 @@ namespace Ink_Canvas
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check at startup");
|
||||
AutoUpdate();
|
||||
}
|
||||
// 当设置被修改时也检查更新(非启动时)
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("AutoUpdate | Running auto-update check after settings change");
|
||||
AutoUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.Startup.IsAutoUpdateWithSilence)
|
||||
{
|
||||
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
|
||||
}
|
||||
|
||||
// 初始化更新通道选择
|
||||
foreach (var radioButton in UpdateChannelSelector.Items)
|
||||
{
|
||||
if (radioButton is RadioButton rb)
|
||||
{
|
||||
if (rb.Tag.ToString() == Settings.Startup.UpdateChannel.ToString())
|
||||
{
|
||||
rb.IsChecked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化更新包架构
|
||||
if (UpdatePackageArchitectureSelector != null)
|
||||
{
|
||||
_isChangingUpdatePackageArchInternally = true;
|
||||
try
|
||||
{
|
||||
string wantTag = Settings.Startup.UpdatePackageArchitecture == UpdatePackageArchitecture.X64 ? "X64" : "X86";
|
||||
foreach (var item in UpdatePackageArchitectureSelector.Items)
|
||||
{
|
||||
if (item is RadioButton rb && rb.Tag != null &&
|
||||
string.Equals(rb.Tag.ToString(), wantTag, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
rb.IsChecked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingUpdatePackageArchInternally = false;
|
||||
}
|
||||
}
|
||||
|
||||
AutoUpdateTimePeriodBlock.Visibility = Settings.Startup.IsAutoUpdateWithSilence
|
||||
? Visibility.Visible
|
||||
: Visibility.Collapsed;
|
||||
|
||||
AutoUpdateWithSilenceTimeComboBox.InitializeAutoUpdateWithSilenceTimeComboBoxOptions(
|
||||
AutoUpdateWithSilenceStartTimeComboBox, AutoUpdateWithSilenceEndTimeComboBox);
|
||||
AutoUpdateWithSilenceStartTimeComboBox.SelectedItem = Settings.Startup.AutoUpdateWithSilenceStartTime;
|
||||
AutoUpdateWithSilenceEndTimeComboBox.SelectedItem = Settings.Startup.AutoUpdateWithSilenceEndTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -789,7 +708,6 @@ namespace Ink_Canvas
|
||||
if (BoardInkAlphaSlider != null) BoardInkAlphaSlider.Value = alpha;
|
||||
|
||||
|
||||
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
|
||||
|
||||
if (Settings.Canvas.UsingWhiteboard)
|
||||
{
|
||||
@@ -810,24 +728,17 @@ namespace Ink_Canvas
|
||||
|
||||
if (Settings.Canvas.IsShowCursor)
|
||||
{
|
||||
ToggleSwitchShowCursor.IsOn = true;
|
||||
inkCanvas.ForceCursor = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleSwitchShowCursor.IsOn = false;
|
||||
inkCanvas.ForceCursor = false;
|
||||
}
|
||||
|
||||
// 初始化压感触屏模式开关状态
|
||||
ToggleSwitchEnablePressureTouchMode.IsOn = Settings.Canvas.EnablePressureTouchMode;
|
||||
|
||||
// 初始化屏蔽压感开关状态
|
||||
ToggleSwitchDisablePressure.IsOn = Settings.Canvas.DisablePressure;
|
||||
inkCanvas.DefaultDrawingAttributes.IgnorePressure = Settings.Canvas.DisablePressure;
|
||||
|
||||
ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth.IsOn =
|
||||
Settings.Canvas.LaunchSeewoVideoShowcaseForWhiteboardBooth;
|
||||
|
||||
if (Settings.Canvas.EnableVelocityBrushTip)
|
||||
{
|
||||
@@ -842,14 +753,9 @@ namespace Ink_Canvas
|
||||
ComboBoxPenStyle.SelectedIndex = penStyleUi;
|
||||
BoardComboBoxPenStyle.SelectedIndex = penStyleUi;
|
||||
|
||||
ComboBoxEraserSize.SelectedIndex = Settings.Canvas.EraserSize;
|
||||
ComboBoxEraserSizeFloatingBar.SelectedIndex = Settings.Canvas.EraserSize;
|
||||
BoardComboBoxEraserSize.SelectedIndex = Settings.Canvas.EraserSize;
|
||||
|
||||
ToggleSwitchClearCanvasAndClearTimeMachine.IsOn =
|
||||
Settings.Canvas.ClearCanvasAndClearTimeMachine;
|
||||
ToggleSwitchClearCanvasAlsoClearImages.IsOn = Settings.Canvas.ClearCanvasAlsoClearImages;
|
||||
ToggleSwitchShowCircleCenter.IsOn = Settings.Canvas.ShowCircleCenter;
|
||||
|
||||
switch (Settings.Canvas.EraserShapeType)
|
||||
{
|
||||
@@ -903,28 +809,21 @@ namespace Ink_Canvas
|
||||
|
||||
CheckEraserTypeTab();
|
||||
|
||||
ToggleSwitchHideStrokeWhenSelecting.IsOn = Settings.Canvas.HideStrokeWhenSelecting;
|
||||
|
||||
// 初始化贝塞尔曲线平滑设置
|
||||
if (Settings.Canvas.UseAdvancedBezierSmoothing)
|
||||
{
|
||||
// 如果启用高级贝塞尔平滑,则禁用原来的FitToCurve
|
||||
ToggleSwitchAdvancedBezierSmoothing.IsOn = true;
|
||||
ToggleSwitchFitToCurve.IsOn = false;
|
||||
drawingAttributes.FitToCurve = false;
|
||||
}
|
||||
else if (Settings.Canvas.FitToCurve)
|
||||
{
|
||||
// 如果启用原来的FitToCurve,则禁用高级贝塞尔平滑
|
||||
ToggleSwitchFitToCurve.IsOn = true;
|
||||
ToggleSwitchAdvancedBezierSmoothing.IsOn = false;
|
||||
drawingAttributes.FitToCurve = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 两者都禁用
|
||||
ToggleSwitchFitToCurve.IsOn = false;
|
||||
ToggleSwitchAdvancedBezierSmoothing.IsOn = false;
|
||||
drawingAttributes.FitToCurve = false;
|
||||
}
|
||||
|
||||
@@ -946,16 +845,10 @@ namespace Ink_Canvas
|
||||
*/
|
||||
|
||||
// 初始化直线自动拉直相关设置
|
||||
ToggleSwitchAutoStraightenLine.IsOn = Settings.Canvas.AutoStraightenLine;
|
||||
AutoStraightenLineThresholdSlider.Value = Settings.Canvas.AutoStraightenLineThreshold;
|
||||
// 直线拉直灵敏度也在这里初始化,即使它存储在InkToShape中
|
||||
LineStraightenSensitivitySlider.Value = Settings.InkToShape.LineStraightenSensitivity;
|
||||
// 初始化高精度直线拉直设置
|
||||
ToggleSwitchHighPrecisionLineStraighten.IsOn = Settings.Canvas.HighPrecisionLineStraighten;
|
||||
|
||||
// 初始化直线端点吸附相关设置
|
||||
ToggleSwitchLineEndpointSnapping.IsOn = Settings.Canvas.LineEndpointSnapping;
|
||||
ToggleSwitchCompressPicturesUploaded.IsOn = Settings.Canvas.IsCompressPicturesUploaded;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1032,30 +925,13 @@ namespace Ink_Canvas
|
||||
// InkToShape
|
||||
if (Settings.InkToShape != null)
|
||||
{
|
||||
ToggleSwitchEnableInkToShape.IsOn = Settings.InkToShape.IsInkToShapeEnabled;
|
||||
|
||||
if (ComboBoxShapeRecognitionEngine != null)
|
||||
{
|
||||
int eng = Settings.InkToShape.ShapeRecognitionEngine;
|
||||
if (eng < 0 || eng > 2) eng = 0;
|
||||
ComboBoxShapeRecognitionEngine.SelectedIndex = eng;
|
||||
}
|
||||
|
||||
if (ToggleSwitchEnableWinRtHandwritingStrokeBeautify != null)
|
||||
ToggleSwitchEnableWinRtHandwritingStrokeBeautify.IsOn =
|
||||
Settings.InkToShape.EnableWinRtHandwritingStrokeBeautify;
|
||||
|
||||
ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn =
|
||||
Settings.InkToShape.IsInkToShapeNoFakePressureRectangle;
|
||||
|
||||
ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn =
|
||||
Settings.InkToShape.IsInkToShapeNoFakePressureTriangle;
|
||||
|
||||
ToggleCheckboxEnableInkToShapeTriangle.IsChecked = Settings.InkToShape.IsInkToShapeTriangle;
|
||||
|
||||
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = Settings.InkToShape.IsInkToShapeRectangle;
|
||||
|
||||
ToggleCheckboxEnableInkToShapeRounded.IsChecked = Settings.InkToShape.IsInkToShapeRounded;
|
||||
|
||||
// 直线拉直灵敏度在Canvas部分已经初始化,这里不再重复
|
||||
}
|
||||
@@ -1315,73 +1191,12 @@ namespace Ink_Canvas
|
||||
{
|
||||
try
|
||||
{
|
||||
// 同步设置面板中的开关状态
|
||||
if (ToggleSwitchBrushAutoRestore != null)
|
||||
{
|
||||
ToggleSwitchBrushAutoRestore.IsOn = Settings.Canvas.EnableBrushAutoRestore;
|
||||
}
|
||||
|
||||
// 同步时间点输入框
|
||||
if (BrushAutoRestoreTimesTextBox != null)
|
||||
{
|
||||
BrushAutoRestoreTimesTextBox.Text = Settings.Canvas.BrushAutoRestoreTimes ?? string.Empty;
|
||||
}
|
||||
|
||||
// 同步颜色下拉框
|
||||
if (ComboBoxBrushAutoRestoreColor != null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Settings.Canvas.BrushAutoRestoreColor))
|
||||
{
|
||||
Settings.Canvas.BrushAutoRestoreColor = "#FFFF0000";
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
foreach (ComboBoxItem item in ComboBoxBrushAutoRestoreColor.Items)
|
||||
{
|
||||
if (item.Tag != null && item.Tag.ToString() == Settings.Canvas.BrushAutoRestoreColor)
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectionChanged -= ComboBoxBrushAutoRestoreColor_SelectionChanged;
|
||||
try
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectedItem = item;
|
||||
}
|
||||
finally
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectionChanged += ComboBoxBrushAutoRestoreColor_SelectionChanged;
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && ComboBoxBrushAutoRestoreColor.Items.Count > 0)
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectionChanged -= ComboBoxBrushAutoRestoreColor_SelectionChanged;
|
||||
try
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectedIndex = 0;
|
||||
Settings.Canvas.BrushAutoRestoreColor = "#FFFF0000";
|
||||
}
|
||||
finally
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectionChanged += ComboBoxBrushAutoRestoreColor_SelectionChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 同步粗细滑块
|
||||
if (BrushAutoRestoreWidthSlider != null)
|
||||
{
|
||||
BrushAutoRestoreWidthSlider.Value = Settings.Canvas.BrushAutoRestoreWidth > 0
|
||||
? Settings.Canvas.BrushAutoRestoreWidth
|
||||
: 5;
|
||||
}
|
||||
|
||||
// 同步透明度滑块
|
||||
if (BrushAutoRestoreAlphaSlider != null)
|
||||
{
|
||||
BrushAutoRestoreAlphaSlider.Value = Settings.Canvas.BrushAutoRestoreAlpha;
|
||||
}
|
||||
|
||||
// 如果功能已启用,初始化并启动定时器
|
||||
if (Settings.Canvas.EnableBrushAutoRestore)
|
||||
@@ -1405,11 +1220,6 @@ namespace Ink_Canvas
|
||||
{
|
||||
try
|
||||
{
|
||||
// 同步设置面板中的开关状态
|
||||
if (ToggleSwitchEnableInkFade != null)
|
||||
{
|
||||
ToggleSwitchEnableInkFade.IsOn = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
// 同步批注子面板中的开关状态
|
||||
if (ToggleSwitchInkFadeInPanel != null)
|
||||
@@ -1423,11 +1233,6 @@ namespace Ink_Canvas
|
||||
ToggleSwitchInkFadeInPanel2.IsOn = Settings.Canvas.EnableInkFade;
|
||||
}
|
||||
|
||||
// 同步滑块值
|
||||
if (InkFadeTimeSlider != null)
|
||||
{
|
||||
InkFadeTimeSlider.Value = Settings.Canvas.InkFadeTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1438,11 +1243,6 @@ namespace Ink_Canvas
|
||||
_inkFadeManager.UpdateFadeTime(Settings.Canvas.InkFadeTime);
|
||||
}
|
||||
|
||||
// 同步在笔工具菜单中隐藏墨迹渐隐控制开关的设置
|
||||
if (ToggleSwitchHideInkFadeControlInPenMenu != null)
|
||||
{
|
||||
ToggleSwitchHideInkFadeControlInPenMenu.IsOn = Settings.Canvas.HideInkFadeControlInPenMenu;
|
||||
}
|
||||
|
||||
// 根据设置更新墨迹渐隐控制开关的可见性
|
||||
UpdateInkFadeControlVisibility();
|
||||
@@ -1584,4 +1384,4 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1388,6 +1388,11 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
public void StartSilentUpdateTimer()
|
||||
{
|
||||
timerCheckAutoUpdateWithSilence.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化橡皮擦自动切换回批注模式计时器
|
||||
/// </summary>
|
||||
|
||||
@@ -1722,6 +1722,12 @@
|
||||
<data name="About_PrivacyCheckboxSuffix" xml:space="preserve">
|
||||
<value> privacy statement</value>
|
||||
</data>
|
||||
<data name="About_PrivacyAndTelemetry" xml:space="preserve">
|
||||
<value>Privacy & Telemetry</value>
|
||||
</data>
|
||||
<data name="About_PrivacyAgreement" xml:space="preserve">
|
||||
<value>I have read and agree to the privacy statement</value>
|
||||
</data>
|
||||
<data name="About_TelemetryLabel" xml:space="preserve">
|
||||
<value>Anonymous usage data upload:</value>
|
||||
</data>
|
||||
|
||||
@@ -1765,6 +1765,12 @@
|
||||
<data name="About_PrivacyCheckboxSuffix" xml:space="preserve">
|
||||
<value> 中的隐私说明</value>
|
||||
</data>
|
||||
<data name="About_PrivacyAndTelemetry" xml:space="preserve">
|
||||
<value>隐私与遥测</value>
|
||||
</data>
|
||||
<data name="About_PrivacyAgreement" xml:space="preserve">
|
||||
<value>我已阅读并同意 privacy 中的隐私说明</value>
|
||||
</data>
|
||||
<data name="About_TelemetryLabel" xml:space="preserve">
|
||||
<value>匿名使用数据上传:</value>
|
||||
</data>
|
||||
|
||||
@@ -1,17 +1,194 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AboutPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
Title="关于"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<StackPanel Margin="24">
|
||||
<TextBlock Text="关于 InkCanvasForClass" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
|
||||
<TextBlock Text="这里是关于页面" Style="{DynamicResource BodyTextBlockStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ui:Page>
|
||||
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AboutPage"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
|
||||
Title="关于">
|
||||
|
||||
<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>
|
||||
<DataTemplate x:Key="DeveloperAvatarTemplate">
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<Image Source="{Binding AvatarPath}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="96" Height="96" Margin="0,0,0,6">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="48,48" RadiusX="48" RadiusY="48" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontSize="18" FontWeight="Bold" Foreground="#fde047" />
|
||||
<TextBlock Text="{Binding Role}" HorizontalAlignment="Center" FontSize="12" Foreground="White" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="ContributorAvatarTemplate">
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<Image Source="{Binding AvatarPath}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="48" Height="48" Margin="0,0,0,4">
|
||||
<Image.Clip>
|
||||
<EllipseGeometry Center="24,24" RadiusX="24" RadiusY="24" />
|
||||
</Image.Clip>
|
||||
</Image>
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontSize="12" Foreground="White" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</DataTemplate>
|
||||
</FrameworkElement.Resources>
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel MaxWidth="1000"
|
||||
HorizontalAlignment="Stretch"
|
||||
Spacing="{StaticResource SettingsCardSpacing}">
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=About_Title}" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_VersionLabel}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Info}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<TextBlock x:Name="AppVersionTextBlock" Text="1.X.X.X" FontWeight="Bold" VerticalAlignment="Center" />
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=About_DeviceInfo}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_DeviceIdLabel}">
|
||||
<TextBlock x:Name="DeviceIdTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_UsageFrequencyLabel}">
|
||||
<TextBlock x:Name="UsageFrequencyTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_UpdatePriorityLabel}">
|
||||
<TextBlock x:Name="UpdatePriorityTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_LaunchCountLabel}">
|
||||
<TextBlock x:Name="LaunchCountTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_TotalUsageLabel}">
|
||||
<TextBlock x:Name="TotalUsageTextBlock" Text="{i18n:I18n Key=About_DeviceInfo_Loading}" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="">
|
||||
<Button x:Name="RefreshDeviceInfoButton" Content="{i18n:I18n Key=About_RefreshDeviceInfo}"
|
||||
Click="RefreshDeviceInfo_Click" />
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander Header="{i18n:I18n Key=About_PrivacyAndTelemetry}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Shield}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckBoxTelemetryPrivacyAccepted"
|
||||
Content="{i18n:I18n Key=About_PrivacyAgreement}"
|
||||
Checked="CheckBoxTelemetryPrivacyAccepted_Checked"
|
||||
Unchecked="CheckBoxTelemetryPrivacyAccepted_Checked" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=About_TelemetryLabel}">
|
||||
<ComboBox x:Name="ComboBoxTelemetryUploadLevel"
|
||||
SelectionChanged="ComboBoxTelemetryUploadLevel_SelectionChanged">
|
||||
<ComboBoxItem Tag="0" Content="{i18n:I18n Key=About_Telemetry_Off}" />
|
||||
<ComboBoxItem Tag="1" Content="{i18n:I18n Key=About_Telemetry_Basic}" />
|
||||
<ComboBoxItem Tag="2" Content="{i18n:I18n Key=About_Telemetry_Optional}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<Border Background="{DynamicResource {x:Static ui:ThemeKeys.LayerFillColorDefaultBrushKey}}"
|
||||
BorderBrush="{DynamicResource {x:Static ui:ThemeKeys.CardStrokeColorDefaultBrushKey}}"
|
||||
CornerRadius="4" BorderThickness="1" Padding="12,10" TextElement.FontSize="14">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8"
|
||||
TextElement.Foreground="{DynamicResource {x:Static ui:ThemeKeys.AccentTextFillColorPrimaryBrushKey}}"
|
||||
Margin="0,3,0,0">
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Info}" FontSize="24"/>
|
||||
<TextBlock FontSize="16" VerticalAlignment="Center" FontWeight="SemiBold"
|
||||
Text="{i18n:I18n Key=About_LicenseTitle}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ikw:SimpleStackPanel Orientation="Vertical" Spacing="12" Grid.Row="1" Margin="5,10">
|
||||
<FrameworkElement.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="LineHeight" Value="21"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
</FrameworkElement.Resources>
|
||||
|
||||
<TextBlock Text="GNU General Public License v3.0" FontSize="20" FontWeight="Bold"/>
|
||||
<TextBlock Text="{i18n:I18n Key=About_LicenseBody}" FontSize="11"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
<Separator Opacity="0.2"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
<ikw:SimpleStackPanel Grid.Row="2" Orientation="Horizontal" Spacing="10">
|
||||
<ui:HyperlinkButton Content="ICC CE" NavigateUri="https://github.com/InkCanvasForClass/community/"/>
|
||||
<ui:HyperlinkButton Content="ICA" NavigateUri="https://github.com/ChangSakura/Ink-Canvas"/>
|
||||
<ui:HyperlinkButton Content="Ink Canvas" NavigateUri="https://github.com/WXRIW/Ink-Canvas"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=About_DevelopersLabel}" />
|
||||
|
||||
<ItemsControl x:Name="DeveloperItemsControl"
|
||||
ItemTemplate="{StaticResource DeveloperAvatarTemplate}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" ItemWidth="130" Margin="0,0,0,8" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
<Separator Margin="0,8" />
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=About_ThanksContributors}" />
|
||||
|
||||
<ItemsControl x:Name="ContributorItemsControl"
|
||||
ItemTemplate="{StaticResource ContributorAvatarTemplate}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" ItemWidth="96" Margin="0,0,0,8" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
<Separator Margin="0,8" />
|
||||
|
||||
<ikw:SimpleStackPanel Spacing="3" Orientation="Vertical" Margin="0,0,0,24">
|
||||
<TextBlock Text="{i18n:I18n Key=About_Copyright}" FontWeight="Bold" TextWrapping="Wrap" />
|
||||
<TextBlock Text="{i18n:I18n Key=About_OpenSourceSlogan}" FontWeight="Bold"
|
||||
TextWrapping="Wrap" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
|
||||
</ikw:SimpleStackPanel>
|
||||
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ui:Page>
|
||||
|
||||
@@ -1,12 +1,424 @@
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
public partial class AboutPage : Page
|
||||
public class AvatarItem
|
||||
{
|
||||
public string AvatarPath { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Role { get; set; }
|
||||
}
|
||||
|
||||
public partial class AboutPage : iNKORE.UI.WPF.Modern.Controls.Page
|
||||
{
|
||||
private bool _isLoaded = false;
|
||||
private bool _isChangingTelemetryInternally;
|
||||
private bool _isChangingTelemetryPrivacyInternally;
|
||||
private DispatcherTimer _usageRefreshTimer;
|
||||
private long _savedTotalSeconds;
|
||||
private DateTime _sessionStartTime;
|
||||
|
||||
public AboutPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += AboutPage_Loaded;
|
||||
Unloaded += AboutPage_Unloaded;
|
||||
InitializeAvatarData();
|
||||
}
|
||||
|
||||
private void InitializeAvatarData()
|
||||
{
|
||||
var developers = new ObservableCollection<AvatarItem>
|
||||
{
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/CJKmkp.jpg", Name = "CJK_mkp", Role = LocalizationHelper.GetString("About_Dev_ICCCE") },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/dubi906w.jpg", Name = "Dubi906w", Role = LocalizationHelper.GetString("About_Dev_ICC") },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/ChangSakura.png", Name = "ChangSakura", Role = LocalizationHelper.GetString("About_Dev_ICA") },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/WXRIW.png", Name = "WXRIW", Role = LocalizationHelper.GetString("About_Dev_InkCanvas") }
|
||||
};
|
||||
|
||||
var contributors = new ObservableCollection<AvatarItem>
|
||||
{
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/RaspberryKan.jpg", Name = "Raspberry Kan" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/kengwang.png", Name = "Kengwang" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/jiajiaxd.jpg", Name = "Charles Jia" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/clover-yan.png", Name = "clover_yan" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/NetheriteBowl.png", Name = "Netherite_Bowl" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/NotYoojun.png", Name = "Yoojun Zhou" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/yuwenhui2020.png", Name = "YuWenHui2020" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/STBBRD.png", Name = "ZongziTEK" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/aaaaaaccd.jpg", Name = "Aesthed" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/wwei.png", Name = "Wei" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/Alan-CRL.png", Name = "Alan-CRL" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/PrefacedCorg.jpg", Name = "PrefacedCorg" },
|
||||
new AvatarItem { AvatarPath = "/Resources/DeveloperAvatars/PANDA-JSR.jpg", Name = "PANDA-JSR" }
|
||||
};
|
||||
|
||||
DeveloperItemsControl.ItemsSource = developers;
|
||||
ContributorItemsControl.ItemsSource = contributors;
|
||||
}
|
||||
|
||||
private void AboutPage_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
_isLoaded = true;
|
||||
|
||||
if (_usageRefreshTimer == null)
|
||||
{
|
||||
_usageRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
|
||||
_usageRefreshTimer.Tick += UsageRefreshTimer_Tick;
|
||||
}
|
||||
_usageRefreshTimer.Start();
|
||||
}
|
||||
|
||||
private void AboutPage_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_usageRefreshTimer != null)
|
||||
{
|
||||
_usageRefreshTimer.Stop();
|
||||
_usageRefreshTimer.Tick -= UsageRefreshTimer_Tick;
|
||||
_usageRefreshTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void UsageRefreshTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
long currentSessionSeconds = (long)(DateTime.Now - _sessionStartTime).TotalSeconds;
|
||||
TotalUsageTextBlock.Text = DeviceIdentifier.FormatDuration(_savedTotalSeconds + currentSessionSeconds);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
_isLoaded = false;
|
||||
|
||||
try
|
||||
{
|
||||
AppVersionTextBlock.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
|
||||
var settings = SettingsManager.Settings;
|
||||
if (settings?.Startup != null)
|
||||
{
|
||||
int idx = 0;
|
||||
switch (settings.Startup.TelemetryUploadLevel)
|
||||
{
|
||||
case TelemetryUploadLevel.None:
|
||||
idx = 0;
|
||||
break;
|
||||
case TelemetryUploadLevel.Basic:
|
||||
idx = 1;
|
||||
break;
|
||||
case TelemetryUploadLevel.Extended:
|
||||
idx = 2;
|
||||
break;
|
||||
default:
|
||||
idx = 0;
|
||||
break;
|
||||
}
|
||||
ComboBoxTelemetryUploadLevel.SelectedIndex = idx;
|
||||
CheckBoxTelemetryPrivacyAccepted.IsChecked = settings.Startup.HasAcceptedTelemetryPrivacy;
|
||||
}
|
||||
|
||||
RefreshDeviceInfo();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"加载关于页面设置时出错: {ex.Message}");
|
||||
}
|
||||
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
private void RefreshDeviceInfo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RefreshDeviceInfo();
|
||||
}
|
||||
|
||||
private void RefreshDeviceInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
string deviceId = DeviceIdentifier.GetDeviceId();
|
||||
DeviceIdTextBlock.Text = deviceId;
|
||||
|
||||
var usageFrequency = DeviceIdentifier.GetUsageFrequency();
|
||||
string frequencyText;
|
||||
switch (usageFrequency)
|
||||
{
|
||||
case DeviceIdentifier.UsageFrequency.High:
|
||||
frequencyText = "高频用户";
|
||||
break;
|
||||
case DeviceIdentifier.UsageFrequency.Medium:
|
||||
frequencyText = "中频用户";
|
||||
break;
|
||||
case DeviceIdentifier.UsageFrequency.Low:
|
||||
frequencyText = "低频用户";
|
||||
break;
|
||||
default:
|
||||
frequencyText = "未知";
|
||||
break;
|
||||
}
|
||||
UsageFrequencyTextBlock.Text = frequencyText;
|
||||
|
||||
var updatePriority = DeviceIdentifier.GetUpdatePriority();
|
||||
string priorityText;
|
||||
switch (updatePriority)
|
||||
{
|
||||
case DeviceIdentifier.UpdatePriority.High:
|
||||
priorityText = "高优先级(优先推送更新)";
|
||||
break;
|
||||
case DeviceIdentifier.UpdatePriority.Medium:
|
||||
priorityText = "中优先级(正常推送更新)";
|
||||
break;
|
||||
case DeviceIdentifier.UpdatePriority.Low:
|
||||
priorityText = "低优先级(延迟推送更新)";
|
||||
break;
|
||||
default:
|
||||
priorityText = "未知";
|
||||
break;
|
||||
}
|
||||
UpdatePriorityTextBlock.Text = priorityText;
|
||||
|
||||
var (launchCount, totalSeconds, avgSessionSeconds, _) = DeviceIdentifier.GetUsageStats();
|
||||
_savedTotalSeconds = totalSeconds;
|
||||
_sessionStartTime = DateTime.Now;
|
||||
LaunchCountTextBlock.Text = launchCount.ToString();
|
||||
TotalUsageTextBlock.Text = DeviceIdentifier.FormatDuration(totalSeconds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"刷新设备信息失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
DeviceIdTextBlock.Text = "获取失败";
|
||||
UsageFrequencyTextBlock.Text = "获取失败";
|
||||
UpdatePriorityTextBlock.Text = "获取失败";
|
||||
LaunchCountTextBlock.Text = "获取失败";
|
||||
TotalUsageTextBlock.Text = "获取失败";
|
||||
}
|
||||
}
|
||||
|
||||
private void ComboBoxTelemetryUploadLevel_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (_isChangingTelemetryInternally) return;
|
||||
var oldLevel = SettingsManager.Settings.Startup.TelemetryUploadLevel;
|
||||
var item = ComboBoxTelemetryUploadLevel?.SelectedItem as ComboBoxItem;
|
||||
if (item == null) return;
|
||||
|
||||
var tag = item.Tag?.ToString() ?? "0";
|
||||
var newLevel = TelemetryUploadLevel.None;
|
||||
switch (tag)
|
||||
{
|
||||
case "1":
|
||||
newLevel = TelemetryUploadLevel.Basic;
|
||||
break;
|
||||
case "2":
|
||||
newLevel = TelemetryUploadLevel.Extended;
|
||||
break;
|
||||
default:
|
||||
newLevel = TelemetryUploadLevel.None;
|
||||
break;
|
||||
}
|
||||
|
||||
if (newLevel == TelemetryUploadLevel.None &&
|
||||
oldLevel != TelemetryUploadLevel.None &&
|
||||
SettingsManager.Settings.Startup.UpdateChannel != UpdateChannel.Release)
|
||||
{
|
||||
var result = MessageBox.Show(
|
||||
"关闭匿名使用数据上传后,将无法继续使用预览/测试通道,系统会自动切换回正式通道(Release)。\n\n是否确认关闭?",
|
||||
"确认关闭遥测",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
if (result != MessageBoxResult.Yes)
|
||||
{
|
||||
_isChangingTelemetryInternally = true;
|
||||
try
|
||||
{
|
||||
int idx = 0;
|
||||
switch (oldLevel)
|
||||
{
|
||||
case TelemetryUploadLevel.Basic:
|
||||
idx = 1;
|
||||
break;
|
||||
case TelemetryUploadLevel.Extended:
|
||||
idx = 2;
|
||||
break;
|
||||
default:
|
||||
idx = 0;
|
||||
break;
|
||||
}
|
||||
ComboBoxTelemetryUploadLevel.SelectedIndex = idx;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryInternally = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.UpdateChannel = UpdateChannel.Release;
|
||||
DeviceIdentifier.UpdateUsageChannel(UpdateChannel.Release);
|
||||
}
|
||||
|
||||
if (newLevel != TelemetryUploadLevel.None && !SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"在开启匿名使用数据上传前,请先阅读并勾选上方的隐私说明。",
|
||||
"需要同意隐私说明",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
_isChangingTelemetryInternally = true;
|
||||
try
|
||||
{
|
||||
SettingsManager.Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.None;
|
||||
if (ComboBoxTelemetryUploadLevel != null)
|
||||
{
|
||||
ComboBoxTelemetryUploadLevel.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryInternally = false;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.TelemetryUploadLevel = newLevel;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void CheckBoxTelemetryPrivacyAccepted_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (_isChangingTelemetryPrivacyInternally) return;
|
||||
|
||||
bool isChecked = CheckBoxTelemetryPrivacyAccepted.IsChecked == true;
|
||||
|
||||
if (isChecked)
|
||||
{
|
||||
if (!PrivacyFileExists())
|
||||
{
|
||||
MessageBox.Show(
|
||||
"未找到隐私说明文件(privacy / privacy.txt),暂时无法启用匿名使用数据上传。",
|
||||
"隐私说明缺失",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
_isChangingTelemetryPrivacyInternally = true;
|
||||
try
|
||||
{
|
||||
CheckBoxTelemetryPrivacyAccepted.IsChecked = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryPrivacyInternally = false;
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy = false;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
return;
|
||||
}
|
||||
|
||||
var privacyWindow = new PrivacyAgreementWindow();
|
||||
bool? dialogResult = privacyWindow.ShowDialog();
|
||||
|
||||
if (dialogResult == true && privacyWindow.UserAccepted)
|
||||
{
|
||||
SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy = true;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isChangingTelemetryPrivacyInternally = true;
|
||||
try
|
||||
{
|
||||
CheckBoxTelemetryPrivacyAccepted.IsChecked = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryPrivacyInternally = false;
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy = false;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = MessageBox.Show(
|
||||
"取消同意隐私说明后,将关闭匿名使用数据上传,并切回正式通道(Release)。\n\n是否确认?",
|
||||
"确认取消隐私同意",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
if (result != MessageBoxResult.Yes)
|
||||
{
|
||||
_isChangingTelemetryPrivacyInternally = true;
|
||||
try
|
||||
{
|
||||
CheckBoxTelemetryPrivacyAccepted.IsChecked = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryPrivacyInternally = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_isChangingTelemetryInternally = true;
|
||||
try
|
||||
{
|
||||
SettingsManager.Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.None;
|
||||
if (ComboBoxTelemetryUploadLevel != null)
|
||||
{
|
||||
ComboBoxTelemetryUploadLevel.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingTelemetryInternally = false;
|
||||
}
|
||||
|
||||
if (SettingsManager.Settings.Startup.UpdateChannel != UpdateChannel.Release)
|
||||
{
|
||||
SettingsManager.Settings.Startup.UpdateChannel = UpdateChannel.Release;
|
||||
DeviceIdentifier.UpdateUsageChannel(UpdateChannel.Release);
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy = false;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool PrivacyFileExists()
|
||||
{
|
||||
try
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var resourceName = "Ink_Canvas.privacy.txt";
|
||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||
{
|
||||
return stream != null;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.CanvasPage"
|
||||
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"
|
||||
xmlns:c="clr-namespace:Ink_Canvas.Converter"
|
||||
mc:Ignorable="d"
|
||||
|
||||
Title="画板">
|
||||
|
||||
<ScrollViewer PanningMode="VerticalFirst">
|
||||
<Grid Margin="59,0,59,0">
|
||||
<FrameworkElement.Resources>
|
||||
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
||||
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<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=Canvas_GroupTitle}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardShowCursor"
|
||||
Header="{i18n:I18n Key=Canvas_ShowCursor}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.PointerHand}"
|
||||
SwitchName="ToggleSwitchShowCursor"
|
||||
Toggled="ToggleSwitchShowCursor_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnablePressureTouchMode"
|
||||
Header="{i18n:I18n Key=Canvas_EnablePressureTouch}"
|
||||
Description="{i18n:I18n Key=Canvas_EnablePressureTouchHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
|
||||
SwitchName="ToggleSwitchEnablePressureTouchMode"
|
||||
Toggled="ToggleSwitchEnablePressureTouchMode_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardDisablePressure"
|
||||
Header="{i18n:I18n Key=Canvas_DisablePressure}"
|
||||
Description="{i18n:I18n Key=Canvas_DisablePressureHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
|
||||
SwitchName="ToggleSwitchDisablePressure"
|
||||
Toggled="ToggleSwitchDisablePressure_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_EraserSize}"
|
||||
Description="{i18n:I18n Key=Canvas_EraserSizeHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.EraseTool}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxEraserSize" Width="160"
|
||||
SelectedIndex="2"
|
||||
SelectionChanged="ComboBoxEraserSize_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_VerySmall}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Small}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Medium}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_Large}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_EraserSize_VeryLarge}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardHideStrokeWhenSelecting"
|
||||
Header="{i18n:I18n Key=Canvas_HideStrokeWhenSelecting}"
|
||||
Description="{i18n:I18n Key=Canvas_HideStrokeWhenSelectingHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Hide}"
|
||||
SwitchName="ToggleSwitchHideStrokeWhenSelecting"
|
||||
Toggled="ToggleSwitchHideStrokeWhenSelecting_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardClearCanvasAndClearTimeMachine"
|
||||
Header="{i18n:I18n Key=Canvas_ClearInkAlsoClearHistory}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Delete}"
|
||||
SwitchName="ToggleSwitchClearCanvasAndClearTimeMachine"
|
||||
Toggled="ToggleSwitchClearCanvasAndClearTimeMachine_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardClearCanvasAlsoClearImages"
|
||||
Header="{i18n:I18n Key=Canvas_ClearCanvasAlsoClearImages}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Photo}"
|
||||
SwitchName="ToggleSwitchClearCanvasAlsoClearImages"
|
||||
Toggled="ToggleSwitchClearCanvasAlsoClearImages_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardCompressPicturesUploaded"
|
||||
Header="{i18n:I18n Key=Canvas_CompressPicturesUploaded}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Clear}"
|
||||
SwitchName="ToggleSwitchCompressPicturesUploaded"
|
||||
Toggled="ToggleSwitchCompressPicturesUploaded_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardLaunchSeewoVideoShowcaseForWhiteboardBooth"
|
||||
Header="{i18n:I18n Key=Canvas_LaunchSeewoVideoShowcaseForWhiteboardBooth}"
|
||||
Description="{i18n:I18n Key=Canvas_LaunchSeewoVideoShowcaseForWhiteboardBoothHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Video}"
|
||||
SwitchName="ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth"
|
||||
Toggled="ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_KeepHyperbolaAsymptote}"
|
||||
Description="{i18n:I18n Key=Canvas_HyperbolaAsymptoteHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AreaChart}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="ComboBoxHyperbolaAsymptoteOption" Width="160"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="ComboBoxHyperbolaAsymptoteOption_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Yes}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_No}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_AskEachTime}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardShowCircleCenter"
|
||||
Header="{i18n:I18n Key=Canvas_ShowCircleCenter}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.CircleRing}"
|
||||
SwitchName="ToggleSwitchShowCircleCenter"
|
||||
Toggled="ToggleSwitchShowCircleCenter_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardFitToCurve"
|
||||
Header="{i18n:I18n Key=Canvas_WPFBezierSmoothing}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.InkingTool}"
|
||||
SwitchName="ToggleSwitchFitToCurve"
|
||||
Toggled="ToggleSwitchFitToCurve_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAdvancedBezierSmoothing"
|
||||
Header="{i18n:I18n Key=Canvas_AdvancedBezierSmoothing}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.InkingTool}"
|
||||
SwitchName="ToggleSwitchAdvancedBezierSmoothing"
|
||||
Toggled="ToggleSwitchAdvancedBezierSmoothing_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableInkFade"
|
||||
Header="{i18n:I18n Key=Canvas_EnableInkFade}"
|
||||
Description="{i18n:I18n Key=Canvas_EnableInkFadeHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Color}"
|
||||
SwitchName="ToggleSwitchEnableInkFade"
|
||||
Toggled="ToggleSwitchEnableInkFade_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_InkFadeTime}"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableInkFade, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Stopwatch}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="InkFadeTimeSlider" Width="150" Minimum="1000" Maximum="10000"
|
||||
Value="3000" TickFrequency="1000" IsSnapToTickEnabled="True"
|
||||
ValueChanged="InkFadeTimeSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=InkFadeTimeSlider, StringFormat={}{0:0}ms}"
|
||||
VerticalAlignment="Center" FontSize="14" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardHideInkFadeControlInPenMenu"
|
||||
Header="{i18n:I18n Key=Canvas_HideInkFadeInPenMenu}"
|
||||
Description="{i18n:I18n Key=Canvas_HideInkFadeInPenMenuHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Hide}"
|
||||
SwitchName="ToggleSwitchHideInkFadeControlInPenMenu"
|
||||
Toggled="ToggleSwitchHideInkFadeControlInPenMenu_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardBrushAutoRestore"
|
||||
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}}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_AutoRestoreTimePoints}">
|
||||
<TextBox x:Name="BrushAutoRestoreTimesTextBox" Width="260"
|
||||
TextChanged="BrushAutoRestoreTimesTextBox_TextChanged" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_RestoreColor}">
|
||||
<ComboBox x:Name="ComboBoxBrushAutoRestoreColor" Width="200"
|
||||
SelectionChanged="ComboBoxBrushAutoRestoreColor_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Default}" Tag="#FFFF0000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Black}" Tag="#FF000000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_White}" Tag="#FFFFFFFF" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Red}" Tag="#FFFF0000" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Yellow}" Tag="#FFFFFF00" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Blue}" Tag="#FF2563EB" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Green}" Tag="#FF16A34A" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Orange}" Tag="#FFFB9650" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Canvas_Color_Purple}" Tag="#FF9333EA" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_RestoreWidth}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="BrushAutoRestoreWidthSlider" Width="200" Minimum="1" Maximum="20"
|
||||
TickFrequency="1" IsSnapToTickEnabled="True" Value="5"
|
||||
ValueChanged="BrushAutoRestoreWidthSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=BrushAutoRestoreWidthSlider, StringFormat={}{0:0}px}"
|
||||
FontSize="12" VerticalAlignment="Center" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_RestoreOpacity}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="BrushAutoRestoreAlphaSlider" Width="200" Minimum="0" Maximum="255"
|
||||
TickFrequency="5" IsSnapToTickEnabled="True"
|
||||
ValueChanged="BrushAutoRestoreAlphaSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=BrushAutoRestoreAlphaSlider, StringFormat={}{0:0}}"
|
||||
FontSize="12" VerticalAlignment="Center" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableEraserAutoSwitchBack"
|
||||
Header="{i18n:I18n Key=Canvas_SwitchBackAfterEraser}"
|
||||
Description="{i18n:I18n Key=Canvas_SwitchBackAfterEraserHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Switch}"
|
||||
SwitchName="ToggleSwitchEnableEraserAutoSwitchBack"
|
||||
Toggled="ToggleSwitchEnableEraserAutoSwitchBack_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Canvas_SwitchBackDelay}"
|
||||
Description="{i18n:I18n Key=Canvas_SwitchBackDelayHint}"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableEraserAutoSwitchBack, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="EraserAutoSwitchBackDelaySlider" Width="150" Minimum="1" Maximum="60"
|
||||
Value="10" TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
ValueChanged="EraserAutoSwitchBackDelaySlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=EraserAutoSwitchBackDelaySlider, StringFormat={}{0:0}秒}"
|
||||
VerticalAlignment="Center" FontSize="14" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=InkRecog_Title}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableInkToShape"
|
||||
Header="{i18n:I18n Key=InkRecog_EnableInkRecognition}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Draw}"
|
||||
SwitchName="ToggleSwitchEnableInkToShape"
|
||||
Toggled="ToggleSwitchEnableInkToShape_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_ShapeEngine}"
|
||||
Description="{i18n:I18n Key=InkRecog_ShapeEngineHint}">
|
||||
<ComboBox x:Name="ComboBoxShapeRecognitionEngine" Width="160"
|
||||
SelectionChanged="ComboBoxShapeRecognitionEngine_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineAuto}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineIACore}" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineWinRT}" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableWinRtHandwritingStrokeBeautify"
|
||||
Header="{i18n:I18n Key=InkRecog_HandwritingBeautify}"
|
||||
Description="{i18n:I18n Key=InkRecog_HandwritingBeautifyHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.PenWorkspace}"
|
||||
SwitchName="ToggleSwitchEnableWinRtHandwritingStrokeBeautify"
|
||||
Toggled="ToggleSwitchEnableWinRtHandwritingStrokeBeautify_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableInkToShapeNoFakePressureRectangle"
|
||||
Header="{i18n:I18n Key=InkRecog_BlockRectFakePressure}"
|
||||
ShowWhen="{Binding IsOn, ElementName=CardEnableInkToShape}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.RectangularClipping}"
|
||||
SwitchName="ToggleSwitchEnableInkToShapeNoFakePressureRectangle"
|
||||
Toggled="ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardEnableInkToShapeNoFakePressureTriangle"
|
||||
Header="{i18n:I18n Key=InkRecog_BlockTriFakePressure}"
|
||||
ShowWhen="{Binding IsOn, ElementName=CardEnableInkToShape}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.IncidentTriangle}"
|
||||
SwitchName="ToggleSwitchEnableInkToShapeNoFakePressureTriangle"
|
||||
Toggled="ToggleSwitchEnableInkToShapeNoFakePressureTriangle_Toggled" />
|
||||
|
||||
<ui:SettingsExpander Header="形状修正"
|
||||
Visibility="{Binding IsOn, ElementName=CardEnableInkToShape, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_FixTriangle}">
|
||||
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeTriangle" IsChecked="True"
|
||||
Checked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_FixRectangle}">
|
||||
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRectangle" IsChecked="True"
|
||||
Checked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged" />
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_FixEllipse}">
|
||||
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRounded" IsChecked="True"
|
||||
Checked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged"
|
||||
Unchecked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged" />
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoStraightenLine"
|
||||
Header="{i18n:I18n Key=InkRecog_AutoStraightLine}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.LineDisplay}"
|
||||
SwitchName="ToggleSwitchAutoStraightenLine"
|
||||
Toggled="ToggleSwitchAutoStraightenLine_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_LengthThreshold}"
|
||||
Visibility="{Binding IsOn, ElementName=CardAutoStraightenLine, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="AutoStraightenLineThresholdSlider" Width="150" Minimum="30" Maximum="300"
|
||||
Value="80" TickFrequency="30" IsSnapToTickEnabled="True"
|
||||
ValueChanged="AutoStraightenLineThresholdSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=AutoStraightenLineThresholdSlider, StringFormat={}{0:0}}"
|
||||
VerticalAlignment="Center" FontSize="14" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_Sensitivity}"
|
||||
Visibility="{Binding IsOn, ElementName=CardAutoStraightenLine, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="LineStraightenSensitivitySlider" Width="150" Minimum="0.05" Maximum="2.0"
|
||||
Value="0.20" TickFrequency="0.05" IsSnapToTickEnabled="True"
|
||||
ValueChanged="LineStraightenSensitivitySlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=LineStraightenSensitivitySlider, StringFormat={}{0:F2}}"
|
||||
VerticalAlignment="Center" FontSize="14" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardHighPrecisionLineStraighten"
|
||||
Header="{i18n:I18n Key=InkRecog_HighPrecisionStraighten}"
|
||||
Description="{i18n:I18n Key=InkRecog_HighPrecisionHint}"
|
||||
ShowWhen="{Binding IsOn, ElementName=CardAutoStraightenLine}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Bullseye}"
|
||||
SwitchName="ToggleSwitchHighPrecisionLineStraighten"
|
||||
Toggled="ToggleSwitchHighPrecisionLineStraighten_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardLineEndpointSnapping"
|
||||
Header="{i18n:I18n Key=InkRecog_LineEndpointSnapping}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Link}"
|
||||
SwitchName="ToggleSwitchLineEndpointSnapping"
|
||||
Toggled="ToggleSwitchLineEndpointSnapping_Toggled" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_SnappingDistance}"
|
||||
Description="{i18n:I18n Key=InkRecog_LineEndpointSnappingHint}"
|
||||
Visibility="{Binding IsOn, ElementName=CardLineEndpointSnapping, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<Slider x:Name="LineEndpointSnappingThresholdSlider" Width="150" Minimum="5" Maximum="50"
|
||||
Value="15" TickFrequency="5" IsSnapToTickEnabled="True"
|
||||
ValueChanged="LineEndpointSnappingThresholdSlider_ValueChanged" />
|
||||
<TextBlock Text="{Binding Value, ElementName=LineEndpointSnappingThresholdSlider, StringFormat={}{0:0}}"
|
||||
VerticalAlignment="Center" FontSize="14" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<Rectangle Height="48" />
|
||||
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ui:Page>
|
||||
@@ -0,0 +1,403 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
public partial class CanvasPage : iNKORE.UI.WPF.Modern.Controls.Page
|
||||
{
|
||||
private bool _isLoaded = false;
|
||||
|
||||
public CanvasPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += CanvasPage_Loaded;
|
||||
}
|
||||
|
||||
private void CanvasPage_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
_isLoaded = false;
|
||||
|
||||
try
|
||||
{
|
||||
var settings = SettingsManager.Settings;
|
||||
if (settings.Canvas != null)
|
||||
{
|
||||
CardShowCursor.IsOn = settings.Canvas.IsShowCursor;
|
||||
CardEnablePressureTouchMode.IsOn = settings.Canvas.EnablePressureTouchMode;
|
||||
CardDisablePressure.IsOn = settings.Canvas.DisablePressure;
|
||||
ComboBoxEraserSize.SelectedIndex = settings.Canvas.EraserSize;
|
||||
CardHideStrokeWhenSelecting.IsOn = settings.Canvas.HideStrokeWhenSelecting;
|
||||
CardClearCanvasAndClearTimeMachine.IsOn = settings.Canvas.ClearCanvasAndClearTimeMachine;
|
||||
CardClearCanvasAlsoClearImages.IsOn = settings.Canvas.ClearCanvasAlsoClearImages;
|
||||
CardCompressPicturesUploaded.IsOn = settings.Canvas.IsCompressPicturesUploaded;
|
||||
CardLaunchSeewoVideoShowcaseForWhiteboardBooth.IsOn = settings.Canvas.LaunchSeewoVideoShowcaseForWhiteboardBooth;
|
||||
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)settings.Canvas.HyperbolaAsymptoteOption;
|
||||
CardShowCircleCenter.IsOn = settings.Canvas.ShowCircleCenter;
|
||||
CardFitToCurve.IsOn = settings.Canvas.FitToCurve;
|
||||
CardAdvancedBezierSmoothing.IsOn = settings.Canvas.UseAdvancedBezierSmoothing;
|
||||
CardEnableInkFade.IsOn = settings.Canvas.EnableInkFade;
|
||||
InkFadeTimeSlider.Value = settings.Canvas.InkFadeTime;
|
||||
CardHideInkFadeControlInPenMenu.IsOn = settings.Canvas.HideInkFadeControlInPenMenu;
|
||||
CardBrushAutoRestore.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;
|
||||
EraserAutoSwitchBackDelaySlider.Value = settings.Canvas.EraserAutoSwitchBackDelaySeconds;
|
||||
CardAutoStraightenLine.IsOn = settings.Canvas.AutoStraightenLine;
|
||||
AutoStraightenLineThresholdSlider.Value = settings.Canvas.AutoStraightenLineThreshold;
|
||||
CardHighPrecisionLineStraighten.IsOn = settings.Canvas.HighPrecisionLineStraighten;
|
||||
CardLineEndpointSnapping.IsOn = settings.Canvas.LineEndpointSnapping;
|
||||
}
|
||||
|
||||
if (settings.InkToShape != null)
|
||||
{
|
||||
CardEnableInkToShape.IsOn = settings.InkToShape.IsInkToShapeEnabled;
|
||||
int eng = settings.InkToShape.ShapeRecognitionEngine;
|
||||
if (eng < 0) eng = 0;
|
||||
if (eng > 2) eng = 2;
|
||||
ComboBoxShapeRecognitionEngine.SelectedIndex = eng;
|
||||
CardEnableWinRtHandwritingStrokeBeautify.IsOn = settings.InkToShape.EnableWinRtHandwritingStrokeBeautify;
|
||||
CardEnableInkToShapeNoFakePressureRectangle.IsOn = settings.InkToShape.IsInkToShapeNoFakePressureRectangle;
|
||||
CardEnableInkToShapeNoFakePressureTriangle.IsOn = settings.InkToShape.IsInkToShapeNoFakePressureTriangle;
|
||||
ToggleCheckboxEnableInkToShapeTriangle.IsChecked = settings.InkToShape.IsInkToShapeTriangle;
|
||||
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = settings.InkToShape.IsInkToShapeRectangle;
|
||||
ToggleCheckboxEnableInkToShapeRounded.IsChecked = settings.InkToShape.IsInkToShapeRounded;
|
||||
LineStraightenSensitivitySlider.Value = settings.InkToShape.LineStraightenSensitivity;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"加载画板设置时出错: {ex.Message}");
|
||||
}
|
||||
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
private void LoadBrushAutoRestoreColor(string hex)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in ComboBoxBrushAutoRestoreColor.Items)
|
||||
{
|
||||
if (item is ComboBoxItem cbi && cbi.Tag != null &&
|
||||
string.Equals(cbi.Tag.ToString(), hex, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ComboBoxBrushAutoRestoreColor.SelectedItem = cbi;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ComboBoxBrushAutoRestoreColor.SelectedIndex = 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"加载画笔恢复颜色时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#region 画板设置事件处理
|
||||
|
||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.IsShowCursor = CardShowCursor.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnablePressureTouchMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnablePressureTouchMode = CardEnablePressureTouchMode.IsOn;
|
||||
if (SettingsManager.Settings.Canvas.EnablePressureTouchMode && SettingsManager.Settings.Canvas.DisablePressure)
|
||||
{
|
||||
SettingsManager.Settings.Canvas.DisablePressure = false;
|
||||
CardDisablePressure.IsOn = false;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchDisablePressure_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.DisablePressure = CardDisablePressure.IsOn;
|
||||
if (SettingsManager.Settings.Canvas.DisablePressure && SettingsManager.Settings.Canvas.EnablePressureTouchMode)
|
||||
{
|
||||
SettingsManager.Settings.Canvas.EnablePressureTouchMode = false;
|
||||
CardEnablePressureTouchMode.IsOn = false;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxEraserSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EraserSize = ComboBoxEraserSize.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchHideStrokeWhenSelecting_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.HideStrokeWhenSelecting = CardHideStrokeWhenSelecting.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchClearCanvasAndClearTimeMachine_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.ClearCanvasAndClearTimeMachine = CardClearCanvasAndClearTimeMachine.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchClearCanvasAlsoClearImages_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.ClearCanvasAlsoClearImages = CardClearCanvasAlsoClearImages.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchCompressPicturesUploaded_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.IsCompressPicturesUploaded = CardCompressPicturesUploaded.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.LaunchSeewoVideoShowcaseForWhiteboardBooth = CardLaunchSeewoVideoShowcaseForWhiteboardBooth.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxHyperbolaAsymptoteOption_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.HyperbolaAsymptoteOption = (OptionalOperation)ComboBoxHyperbolaAsymptoteOption.SelectedIndex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCircleCenter_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.ShowCircleCenter = CardShowCircleCenter.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchFitToCurve_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.FitToCurve = CardFitToCurve.IsOn;
|
||||
if (CardFitToCurve.IsOn)
|
||||
{
|
||||
SettingsManager.Settings.Canvas.UseAdvancedBezierSmoothing = false;
|
||||
CardAdvancedBezierSmoothing.IsOn = false;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAdvancedBezierSmoothing_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.UseAdvancedBezierSmoothing = CardAdvancedBezierSmoothing.IsOn;
|
||||
if (CardAdvancedBezierSmoothing.IsOn)
|
||||
{
|
||||
SettingsManager.Settings.Canvas.FitToCurve = false;
|
||||
CardFitToCurve.IsOn = false;
|
||||
}
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableInkFade_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableInkFade = CardEnableInkFade.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void InkFadeTimeSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.InkFadeTime = (int)e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchHideInkFadeControlInPenMenu_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.HideInkFadeControlInPenMenu = CardHideInkFadeControlInPenMenu.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchBrushAutoRestore_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableBrushAutoRestore = CardBrushAutoRestore.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void BrushAutoRestoreTimesTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.BrushAutoRestoreTimes = BrushAutoRestoreTimesTextBox.Text ?? string.Empty;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxBrushAutoRestoreColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (ComboBoxBrushAutoRestoreColor.SelectedItem is ComboBoxItem item)
|
||||
{
|
||||
string hex = item.Tag as string ?? string.Empty;
|
||||
SettingsManager.Settings.Canvas.BrushAutoRestoreColor = hex;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
|
||||
private void BrushAutoRestoreWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.BrushAutoRestoreWidth = e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void BrushAutoRestoreAlphaSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.BrushAutoRestoreAlpha = (int)e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableEraserAutoSwitchBack_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EnableEraserAutoSwitchBack = CardEnableEraserAutoSwitchBack.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void EraserAutoSwitchBackDelaySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.EraserAutoSwitchBackDelaySeconds = (int)e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 墨迹识别事件处理
|
||||
|
||||
private void ToggleSwitchEnableInkToShape_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeEnabled = CardEnableInkToShape.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ComboBoxShapeRecognitionEngine_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded || ComboBoxShapeRecognitionEngine == null) return;
|
||||
int idx = ComboBoxShapeRecognitionEngine.SelectedIndex;
|
||||
if (idx < 0) idx = 0;
|
||||
if (idx > 2) idx = 2;
|
||||
SettingsManager.Settings.InkToShape.ShapeRecognitionEngine = idx;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableWinRtHandwritingStrokeBeautify_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.EnableWinRtHandwritingStrokeBeautify = CardEnableWinRtHandwritingStrokeBeautify.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeNoFakePressureRectangle = CardEnableInkToShapeNoFakePressureRectangle.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableInkToShapeNoFakePressureTriangle_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeNoFakePressureTriangle = CardEnableInkToShapeNoFakePressureTriangle.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeTriangle = (bool)ToggleCheckboxEnableInkToShapeTriangle.IsChecked;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeRectangle = (bool)ToggleCheckboxEnableInkToShapeRectangle.IsChecked;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleCheckboxEnableInkToShapeRounded_CheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.IsInkToShapeRounded = (bool)ToggleCheckboxEnableInkToShapeRounded.IsChecked;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoStraightenLine_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.AutoStraightenLine = CardAutoStraightenLine.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void AutoStraightenLineThresholdSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.AutoStraightenLineThreshold = (int)e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void LineStraightenSensitivitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.InkToShape.LineStraightenSensitivity = e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchHighPrecisionLineStraighten_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.HighPrecisionLineStraighten = CardHighPrecisionLineStraighten.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchLineEndpointSnapping_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.LineEndpointSnapping = CardLineEndpointSnapping.IsOn;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void LineEndpointSnappingThresholdSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
SettingsManager.Settings.Canvas.LineEndpointSnappingThreshold = (int)e.NewValue;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,8 @@
|
||||
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"
|
||||
xmlns:c="clr-namespace:Ink_Canvas.Converter"
|
||||
mc:Ignorable="d"
|
||||
|
||||
Title="启动">
|
||||
|
||||
@@ -18,6 +19,7 @@
|
||||
<Grid Margin="59,0,59,0">
|
||||
<FrameworkElement.Resources>
|
||||
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
||||
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
|
||||
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
||||
TargetType="TextBlock">
|
||||
@@ -113,22 +115,17 @@
|
||||
Icon="{x:Static ui:SegoeFluentIcons.ChevronLeft}"
|
||||
SwitchName="ToggleSwitchFoldAtStartup"
|
||||
Toggled="ToggleSwitchFoldAtStartup_Toggled" />
|
||||
|
||||
<!-- 模式设置 -->
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="模式设置" />
|
||||
|
||||
<ui:SettingsExpander Description="{i18n:I18n Key=Settings_ModeDesc}"
|
||||
Header="{i18n:I18n Key=Settings_ModeDesc_1}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="仅PPT模式">
|
||||
<ui:ToggleSwitch Name="ToggleSwitchPPTOnlyMode" OnContent="{i18n:I18n Key=Common_On}" OffContent="{i18n:I18n Key=Common_Off}" Toggled="ToggleSwitchPPTOnlyMode_Toggled" />
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
<!-- 运行模式 -->
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{i18n:I18n Key=Settings_ModeDesc_1}" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardPPTOnlyMode"
|
||||
Header="{i18n:I18n Key=Mode_PPTOnly}"
|
||||
Description="{i18n:I18n Key=Settings_ModeDesc}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Settings}"
|
||||
SwitchName="ToggleSwitchPPTOnlyMode"
|
||||
Toggled="ToggleSwitchPPTOnlyMode_Toggled" />
|
||||
|
||||
<!-- 底部空白 -->
|
||||
<Rectangle Height="48" />
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
if (settings.ModeSettings != null)
|
||||
{
|
||||
ToggleSwitchPPTOnlyMode.IsOn = settings.ModeSettings.IsPPTOnlyMode;
|
||||
CardPPTOnlyMode.IsOn = settings.ModeSettings.IsPPTOnlyMode;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -361,7 +361,7 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchPPTOnlyMode.IsOn;
|
||||
bool newState = CardPPTOnlyMode.IsOn;
|
||||
|
||||
var window = Application.Current.MainWindow;
|
||||
if (window != null)
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.UpdatePage"
|
||||
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"
|
||||
xmlns:c="clr-namespace:Ink_Canvas.Converter"
|
||||
mc:Ignorable="d"
|
||||
|
||||
Title="更新">
|
||||
|
||||
<ScrollViewer PanningMode="VerticalFirst">
|
||||
<Grid Margin="59,0,59,0">
|
||||
<FrameworkElement.Resources>
|
||||
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
||||
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<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="自动更新" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardAutoUpdate"
|
||||
Header="{i18n:I18n Key=Header_AutoUpdate}"
|
||||
Description="{i18n:I18n Key=Startup_AutoUpdateHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.Sync}"
|
||||
SwitchName="ToggleSwitchIsAutoUpdate"
|
||||
Toggled="ToggleSwitchIsAutoUpdate_Toggled" />
|
||||
|
||||
<controls:LabeledSettingsCard x:Name="CardSilentUpdate"
|
||||
Header="{i18n:I18n Key=Header_SilentUpdate}"
|
||||
Description="{i18n:I18n Key=Startup_SilentUpdateHint}"
|
||||
Icon="{x:Static ui:SegoeFluentIcons.QuietHours}"
|
||||
SwitchName="ToggleSwitchIsAutoUpdateWithSilence"
|
||||
ShowWhen="{Binding IsOn, ElementName=CardAutoUpdate}"
|
||||
Toggled="ToggleSwitchIsAutoUpdateWithSilence_Toggled" />
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderSilentUpdateTime"
|
||||
Header="{i18n:I18n Key=Startup_SilentUpdateTimePeriod}"
|
||||
Visibility="{Binding IsOn, ElementName=CardSilentUpdate, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Startup_SilentUpdateFullHint}">
|
||||
<ui:SettingsCard.Content>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
|
||||
Text="{i18n:I18n Key=Startup_StartTime}" FontSize="14" />
|
||||
<ComboBox x:Name="AutoUpdateWithSilenceStartTimeComboBox" Width="90"
|
||||
SelectionChanged="AutoUpdateWithSilenceStartTimeComboBox_SelectionChanged" />
|
||||
</ikw:SimpleStackPanel>
|
||||
<ikw:SimpleStackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="0,0,10,0" VerticalAlignment="Center"
|
||||
Text="{i18n:I18n Key=Startup_EndTime}" FontSize="14" />
|
||||
<ComboBox x:Name="AutoUpdateWithSilenceEndTimeComboBox" Width="90"
|
||||
SelectionChanged="AutoUpdateWithSilenceEndTimeComboBox_SelectionChanged" />
|
||||
</ikw:SimpleStackPanel>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard.Content>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Startup_TimePeriodHint}" />
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="更新通道" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Startup_UpdateChannel}"
|
||||
Description="{i18n:I18n Key=Startup_UpdateChannelHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.SyncFolder}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="UpdateChannelSelector" Width="160"
|
||||
SelectionChanged="UpdateChannelSelector_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Update_Release}" Tag="Release" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Update_Preview}" Tag="Preview" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Update_Beta}" Tag="Beta" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Startup_UpdatePackageArchitecture}"
|
||||
Description="{i18n:I18n Key=Startup_UpdatePackageArchitectureHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DeveloperTools}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ComboBox x:Name="UpdatePackageArchitectureSelector" Width="160"
|
||||
SelectionChanged="UpdatePackageArchitectureSelector_SelectionChanged">
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Update_PackageArch_X86}" Tag="X86" />
|
||||
<ComboBoxItem Content="{i18n:I18n Key=Update_PackageArch_X64}" Tag="X64" />
|
||||
</ComboBox>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="手动操作" />
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Btn_ManualUpdate}"
|
||||
Description="{i18n:I18n Key=Startup_ManualUpdateHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Search}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<Button x:Name="ManualUpdateButton" Content="{i18n:I18n Key=Btn_ManualUpdate}"
|
||||
Click="ManualUpdateButton_Click" />
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Btn_FixVersion}"
|
||||
Description="{i18n:I18n Key=Startup_FixVersionHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Repair}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<Button x:Name="FixVersionButton" Content="{i18n:I18n Key=Btn_FixVersion}"
|
||||
Click="FixVersionButton_Click" />
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="{i18n:I18n Key=Btn_HistoryRollback}"
|
||||
Description="{i18n:I18n Key=Startup_HistoryRollbackHint}">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.History}" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<Button Content="{i18n:I18n Key=Btn_HistoryRollback}"
|
||||
Click="HistoryRollbackButton_Click" />
|
||||
</ui:SettingsCard>
|
||||
|
||||
<Rectangle Height="48" />
|
||||
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</ui:Page>
|
||||
@@ -0,0 +1,468 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.SettingsViews.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews.Pages
|
||||
{
|
||||
public partial class UpdatePage : iNKORE.UI.WPF.Modern.Controls.Page
|
||||
{
|
||||
private bool _isLoaded = false;
|
||||
private bool _isChangingUpdateChannelInternally = false;
|
||||
private bool _isChangingUpdatePackageArchInternally = false;
|
||||
|
||||
public UpdatePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += UpdatePage_Loaded;
|
||||
}
|
||||
|
||||
private void UpdatePage_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
_isLoaded = false;
|
||||
|
||||
try
|
||||
{
|
||||
var settings = SettingsManager.Settings;
|
||||
if (settings.Startup != null)
|
||||
{
|
||||
CardAutoUpdate.IsOn = settings.Startup.IsAutoUpdate;
|
||||
CardSilentUpdate.IsOn = settings.Startup.IsAutoUpdateWithSilence;
|
||||
|
||||
AutoUpdateWithSilenceTimeComboBox.InitializeAutoUpdateWithSilenceTimeComboBoxOptions(
|
||||
AutoUpdateWithSilenceStartTimeComboBox, AutoUpdateWithSilenceEndTimeComboBox);
|
||||
AutoUpdateWithSilenceStartTimeComboBox.SelectedItem = settings.Startup.AutoUpdateWithSilenceStartTime;
|
||||
AutoUpdateWithSilenceEndTimeComboBox.SelectedItem = settings.Startup.AutoUpdateWithSilenceEndTime;
|
||||
|
||||
foreach (var item in UpdateChannelSelector.Items)
|
||||
{
|
||||
if (item is ComboBoxItem cbi && cbi.Tag != null &&
|
||||
string.Equals(cbi.Tag.ToString(), settings.Startup.UpdateChannel.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UpdateChannelSelector.SelectedItem = cbi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_isChangingUpdatePackageArchInternally = true;
|
||||
try
|
||||
{
|
||||
string wantTag = settings.Startup.UpdatePackageArchitecture == UpdatePackageArchitecture.X64 ? "X64" : "X86";
|
||||
foreach (var item in UpdatePackageArchitectureSelector.Items)
|
||||
{
|
||||
if (item is ComboBoxItem cbi && cbi.Tag != null &&
|
||||
string.Equals(cbi.Tag.ToString(), wantTag, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UpdatePackageArchitectureSelector.SelectedItem = cbi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingUpdatePackageArchInternally = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"加载更新设置时出错: {ex.Message}");
|
||||
}
|
||||
|
||||
_isLoaded = true;
|
||||
}
|
||||
|
||||
#region 自动更新事件处理
|
||||
|
||||
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
bool newState = CardAutoUpdate.IsOn;
|
||||
SettingsManager.Settings.Startup.IsAutoUpdate = newState;
|
||||
|
||||
if (!newState)
|
||||
{
|
||||
SettingsManager.Settings.Startup.IsAutoUpdateWithSilence = false;
|
||||
CardSilentUpdate.IsOn = false;
|
||||
}
|
||||
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置自动更新时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
bool newState = CardSilentUpdate.IsOn;
|
||||
SettingsManager.Settings.Startup.IsAutoUpdateWithSilence = newState;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置静默更新时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoUpdateWithSilenceStartTimeComboBox_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
SettingsManager.Settings.Startup.AutoUpdateWithSilenceStartTime =
|
||||
(string)AutoUpdateWithSilenceStartTimeComboBox.SelectedItem;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置静默更新开始时间时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoUpdateWithSilenceEndTimeComboBox_SelectionChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
|
||||
try
|
||||
{
|
||||
SettingsManager.Settings.Startup.AutoUpdateWithSilenceEndTime =
|
||||
(string)AutoUpdateWithSilenceEndTimeComboBox.SelectedItem;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"设置静默更新结束时间时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 更新通道和架构事件处理
|
||||
|
||||
private void UpdatePackageArchitectureSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (_isChangingUpdatePackageArchInternally) return;
|
||||
if (!(UpdatePackageArchitectureSelector.SelectedItem is ComboBoxItem cbi) || cbi.Tag == null) return;
|
||||
|
||||
var newArch = string.Equals(cbi.Tag.ToString(), "X64", StringComparison.OrdinalIgnoreCase)
|
||||
? UpdatePackageArchitecture.X64
|
||||
: UpdatePackageArchitecture.X86;
|
||||
|
||||
if (SettingsManager.Settings.Startup.UpdatePackageArchitecture == newArch)
|
||||
return;
|
||||
|
||||
SettingsManager.Settings.Startup.UpdatePackageArchitecture = newArch;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
LogHelper.WriteLogToFile($"Settings | Update package architecture: {newArch}");
|
||||
}
|
||||
|
||||
private async void UpdateChannelSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!_isLoaded) return;
|
||||
if (_isChangingUpdateChannelInternally) return;
|
||||
if (!(UpdateChannelSelector.SelectedItem is ComboBoxItem cbi) || cbi.Tag == null) return;
|
||||
|
||||
var oldChannel = SettingsManager.Settings.Startup.UpdateChannel;
|
||||
string channel = cbi.Tag.ToString();
|
||||
UpdateChannel newChannel = channel == "Beta" ? UpdateChannel.Beta
|
||||
: channel == "Preview" ? UpdateChannel.Preview
|
||||
: UpdateChannel.Release;
|
||||
|
||||
if (SettingsManager.Settings.Startup.UpdateChannel == newChannel)
|
||||
return;
|
||||
|
||||
bool isTestChannel = newChannel == UpdateChannel.Preview || newChannel == UpdateChannel.Beta;
|
||||
|
||||
if (isTestChannel && !SettingsManager.Settings.Startup.HasAcceptedTelemetryPrivacy)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"加入预览 / 测试通道前,请先在关于页面勾选\u201C我已阅读并同意 privacy 中的隐私说明\u201D。",
|
||||
"需要同意隐私说明",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
SettingsManager.Settings.Startup.UpdateChannel = oldChannel;
|
||||
RevertChannelSelection(oldChannel);
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
LogHelper.WriteLogToFile("Settings | User not accepted privacy, reverted update channel");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isTestChannel && SettingsManager.Settings.Startup.TelemetryUploadLevel == TelemetryUploadLevel.None)
|
||||
{
|
||||
var result = MessageBox.Show(
|
||||
"加入预览 / 测试通道需要开启匿名基础数据上传。\n\n是否立即开启匿名基础数据上传?",
|
||||
"需要开启匿名使用数据上传",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Warning);
|
||||
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
SettingsManager.Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.Basic;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
LogHelper.WriteLogToFile("Settings | Telemetry enabled (Basic) for preview/beta update channel");
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingsManager.Settings.Startup.UpdateChannel = oldChannel;
|
||||
RevertChannelSelection(oldChannel);
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
LogHelper.WriteLogToFile("Settings | User declined telemetry, reverted update channel");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SettingsManager.Settings.Startup.UpdateChannel = newChannel;
|
||||
DeviceIdentifier.UpdateUsageChannel(newChannel);
|
||||
LogHelper.WriteLogToFile($"Settings | Update channel changed to {SettingsManager.Settings.Startup.UpdateChannel}");
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
|
||||
if (SettingsManager.Settings.Startup.IsAutoUpdate)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Channel changed to {newChannel}, performing immediate update check");
|
||||
|
||||
var mainWindow = Application.Current.MainWindow as MainWindow;
|
||||
if (mainWindow != null)
|
||||
{
|
||||
mainWindow.ResetUpdateCheckRetry();
|
||||
await System.Threading.Tasks.Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
mainWindow.AutoUpdate();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Error during channel switch update check: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile($"AutoUpdate | Channel changed to {newChannel}, but auto-update is disabled");
|
||||
}
|
||||
}
|
||||
|
||||
private void RevertChannelSelection(UpdateChannel targetChannel)
|
||||
{
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
_isChangingUpdateChannelInternally = true;
|
||||
try
|
||||
{
|
||||
string targetTag = targetChannel.ToString();
|
||||
foreach (var item in UpdateChannelSelector.Items)
|
||||
{
|
||||
if (item is ComboBoxItem cbi && cbi.Tag != null &&
|
||||
string.Equals(cbi.Tag.ToString(), targetTag, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UpdateChannelSelector.SelectedItem = cbi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isChangingUpdateChannelInternally = false;
|
||||
}
|
||||
}), DispatcherPriority.Normal);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 手动操作事件处理
|
||||
|
||||
private async void ManualUpdateButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ManualUpdateButton.IsEnabled = false;
|
||||
ManualUpdateButton.Content = "正在检查更新...";
|
||||
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | Manual update button clicked");
|
||||
|
||||
var (remoteVersion, lineGroup, apiReleaseNotes) = await AutoUpdateHelper.CheckForUpdates(SettingsManager.Settings.Startup.UpdateChannel, true, false);
|
||||
|
||||
if (remoteVersion != null)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"ManualUpdate | Found new version: {remoteVersion}");
|
||||
|
||||
string currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
|
||||
HasNewUpdateWindow updateWindow = new HasNewUpdateWindow(currentVersion, remoteVersion, "", apiReleaseNotes);
|
||||
updateWindow.Owner = Application.Current.MainWindow;
|
||||
bool? dialogResult = updateWindow.ShowDialog();
|
||||
|
||||
if (dialogResult != true)
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | Update dialog closed without selection");
|
||||
return;
|
||||
}
|
||||
|
||||
var mainWindow = Application.Current.MainWindow as MainWindow;
|
||||
|
||||
switch (updateWindow.Result)
|
||||
{
|
||||
case HasNewUpdateWindow.UpdateResult.UpdateNow:
|
||||
LogHelper.WriteLogToFile("ManualUpdate | User chose to update now");
|
||||
MessageBox.Show("开始下载更新,请稍候...", "正在更新", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
bool isDownloadSuccessful = mainWindow != null
|
||||
&& await mainWindow.DownloadUpdateWithFallback(remoteVersion, lineGroup, SettingsManager.Settings.Startup.UpdateChannel);
|
||||
|
||||
if (isDownloadSuccessful)
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("更新已下载完成,点击确定后将关闭软件并安装新版本!", "安装更新", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
||||
|
||||
if (result == MessageBoxResult.OK)
|
||||
{
|
||||
App.IsAppExitByUser = true;
|
||||
AutoUpdateHelper.InstallNewVersionApp(remoteVersion, true);
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | User cancelled update installation");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("更新下载失败,请检查网络连接后重试。", "下载失败", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
break;
|
||||
|
||||
case HasNewUpdateWindow.UpdateResult.UpdateLater:
|
||||
LogHelper.WriteLogToFile("ManualUpdate | User chose to update later");
|
||||
|
||||
isDownloadSuccessful = mainWindow != null
|
||||
&& await mainWindow.DownloadUpdateWithFallback(remoteVersion, lineGroup, SettingsManager.Settings.Startup.UpdateChannel);
|
||||
|
||||
if (isDownloadSuccessful)
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | Update downloaded successfully, will install when application closes");
|
||||
SettingsManager.Settings.Startup.IsAutoUpdate = true;
|
||||
SettingsManager.Settings.Startup.IsAutoUpdateWithSilence = true;
|
||||
|
||||
if (mainWindow != null)
|
||||
mainWindow.StartSilentUpdateTimer();
|
||||
|
||||
MessageBox.Show("更新已下载完成,将在软件关闭时自动安装。", "更新已准备就绪", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | Update download failed", LogHelper.LogType.Error);
|
||||
MessageBox.Show("更新下载失败,请检查网络连接后重试。", "下载失败", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
break;
|
||||
|
||||
case HasNewUpdateWindow.UpdateResult.SkipVersion:
|
||||
LogHelper.WriteLogToFile($"ManualUpdate | User chose to skip version {remoteVersion}");
|
||||
SettingsManager.Settings.Startup.SkippedVersion = remoteVersion;
|
||||
SettingsManager.SaveSettingsToFile();
|
||||
MessageBox.Show($"已设置跳过版本 {remoteVersion},在下次发布新版本之前不会再提示更新。",
|
||||
"已跳过此版本",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Information);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogToFile("ManualUpdate | No updates available");
|
||||
MessageBox.Show("当前已是最新版本!", "无可用更新", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"Error in ManualUpdateButton_Click: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show(
|
||||
$"手动更新过程中发生错误: {ex.Message}",
|
||||
"更新错误",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ManualUpdateButton.IsEnabled = true;
|
||||
ManualUpdateButton.Content = "手动更新";
|
||||
}
|
||||
}
|
||||
|
||||
private async void FixVersionButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var confirm = MessageBox.Show(
|
||||
"此操作将下载当前选择通道的最新版本并安装,软件将自动关闭并更新。\n\n确定要执行版本修复吗?",
|
||||
"版本修复确认",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Question);
|
||||
|
||||
if (confirm == MessageBoxResult.Yes)
|
||||
{
|
||||
FixVersionButton.IsEnabled = false;
|
||||
FixVersionButton.Content = "正在修复...";
|
||||
|
||||
try
|
||||
{
|
||||
bool result = await AutoUpdateHelper.FixVersion(SettingsManager.Settings.Startup.UpdateChannel);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"版本修复失败,可能是网络问题或当前已是最新版本。",
|
||||
"修复失败",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Error);
|
||||
|
||||
FixVersionButton.IsEnabled = true;
|
||||
FixVersionButton.Content = "版本修复";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"Error in FixVersionButton_Click: {ex.Message}", LogHelper.LogType.Error);
|
||||
MessageBox.Show(
|
||||
$"版本修复过程中发生错误: {ex.Message}",
|
||||
"修复错误",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Error);
|
||||
|
||||
FixVersionButton.IsEnabled = true;
|
||||
FixVersionButton.Content = "版本修复";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void HistoryRollbackButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var win = new HistoryRollbackWindow(SettingsManager.Settings.Startup.UpdateChannel);
|
||||
win.Owner = Application.Current.MainWindow;
|
||||
win.ShowDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -147,86 +147,39 @@
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<!-- 页面2 -->
|
||||
<!-- 更新设置 -->
|
||||
<ui:NavigationViewItem
|
||||
x:Name="Page2Item"
|
||||
Content="页面 2"
|
||||
Tag="Page2Page">
|
||||
x:Name="UpdatePageItem"
|
||||
Content="更新"
|
||||
Tag="UpdatePage"
|
||||
ToolTipService.ToolTip="更新设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Document" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Sync}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<!-- 设计设置 -->
|
||||
<!-- 画板设置 -->
|
||||
<ui:NavigationViewItem
|
||||
x:Name="DesignItem"
|
||||
Content="设计"
|
||||
Tag="DesignPage"
|
||||
SelectsOnInvoked="True">
|
||||
x:Name="CanvasPageItem"
|
||||
Content="画板"
|
||||
Tag="CanvasPage"
|
||||
ToolTipService.ToolTip="画板与墨迹设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Design}"/>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Edit}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="IconographyItem"
|
||||
Content="图标"
|
||||
Tag="IconographyPage"
|
||||
ToolTipService.ToolTip="图标设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AllApps}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="TypographyItem"
|
||||
Content="排版"
|
||||
Tag="TypographyPage"
|
||||
ToolTipService.ToolTip="排版设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<!-- 外观设置 -->
|
||||
<!-- Debug -->
|
||||
<ui:NavigationViewItem
|
||||
x:Name="AppearanceItem"
|
||||
Content="外观"
|
||||
Tag="AppearancePage"
|
||||
SelectsOnInvoked="True">
|
||||
x:Name="DebugPageItem"
|
||||
Content="Debug"
|
||||
Tag="DebugPage"
|
||||
ToolTipService.ToolTip="Debug">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DeveloperTools}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="ThemeItem"
|
||||
Content="主题"
|
||||
Tag="ThemePage"
|
||||
ToolTipService.ToolTip="主题设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:FluentSystemIcons.DarkTheme_24_Regular}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="ColorsItem"
|
||||
Content="颜色"
|
||||
Tag="ColorsPage"
|
||||
ToolTipService.ToolTip="颜色设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Highlight}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="FontsItem"
|
||||
Content="字体"
|
||||
Tag="FontsPage"
|
||||
ToolTipService.ToolTip="字体设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<ui:NavigationViewItemHeader Content="插件设置"/>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="PluginItem"
|
||||
|
||||
@@ -36,15 +36,10 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
{ "HomePage", typeof(HomePage) },
|
||||
{ "BasicPage", typeof(BasicPage) },
|
||||
{ "Page2Page", typeof(Page2Page) },
|
||||
{ "DesignPage", typeof(DesignPage) },
|
||||
{ "AppearancePage", typeof(AppearancePage) },
|
||||
{ "IconographyPage", typeof(IconographyPage) },
|
||||
{ "TypographyPage", typeof(TypographyPage) },
|
||||
{ "ThemePage", typeof(ThemePage) },
|
||||
{ "ColorsPage", typeof(ColorsPage) },
|
||||
{ "FontsPage", typeof(FontsPage) },
|
||||
{ "StartupPage", typeof(StartupPage) },
|
||||
{ "UpdatePage", typeof(UpdatePage) },
|
||||
{ "CanvasPage", typeof(CanvasPage) },
|
||||
{ "DebugPage", typeof(IconographyPage) },
|
||||
{ "AboutPage", typeof(AboutPage) },
|
||||
{ "Settings", typeof(SettingsPage) },
|
||||
{ "PluginPage", typeof(PluginPage) },
|
||||
|
||||
Reference in New Issue
Block a user