add:新设置

This commit is contained in:
PrefacedCorg
2026-04-23 06:48:52 +08:00
parent 259ce3dd11
commit b949b1651a
24 changed files with 1838 additions and 3526 deletions
-11
View File
@@ -1113,17 +1113,6 @@ namespace Ink_Canvas
LogHelper.WriteLogToFile($"Failed to register InkCanvasService: {ex.Message}", LogHelper.LogType.Error);
}
try
{
var appRestartService = new Plugins.AppRestartService();
Plugins.PluginManager.Instance.RegisterService<Plugins.IAppRestartService>(appRestartService);
LogHelper.WriteLogToFile("AppRestartService registered for plugins");
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"Failed to register AppRestartService: {ex.Message}", LogHelper.LogType.Error);
}
// 主窗口加载完成后关闭启动画面
mainWindow.Loaded += (s, args) =>
{
File diff suppressed because it is too large Load Diff
+6 -80
View File
@@ -1,4 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Helpers;
using Ink_Canvas.Windows.SettingsViews.Helpers;
using Ink_Canvas.Windows;
using iNKORE.UI.WPF.Modern;
@@ -471,17 +471,6 @@ namespace Ink_Canvas
if (timerContainer.HorizontalAlignment == HorizontalAlignment.Center &&
timerContainer.VerticalAlignment == VerticalAlignment.Center)
{
var timerPoint = timerContainer.TransformToAncestor(this).Transform(new Point(0, 0));
x = timerPoint.X;
y = timerPoint.Y;
}
else
{
var timerMargin = timerContainer.Margin;
x = double.IsNaN(timerMargin.Left) ? 0 : timerMargin.Left;
y = double.IsNaN(timerMargin.Top) ? 0 : timerMargin.Top;
}
minimizedContainer.Margin = new Thickness(x, y, 0, 0);
minimizedContainer.HorizontalAlignment = HorizontalAlignment.Left;
@@ -637,7 +626,6 @@ namespace Ink_Canvas
string n = hex.Trim().ToLowerInvariant();
if (n.StartsWith("#")) n = n.Substring(1);
if (n.Length == 8) n = n.Substring(2, 6); // 去掉 AA
else if (n.Length != 6) n = "";
if (n.Length == 6)
{
@@ -705,24 +693,10 @@ namespace Ink_Canvas
if (currentMode == 0)
{
if (rgbColor == Colors.White) lastDesktopInkColor = 5;
else if (rgbColor == Color.FromRgb(251, 150, 80)) lastDesktopInkColor = 8;
else if (rgbColor == Colors.Yellow) lastDesktopInkColor = 4;
else if (rgbColor == Colors.Black) lastDesktopInkColor = 0;
else if (rgbColor == Color.FromRgb(37, 99, 235)) lastDesktopInkColor = 3;
else if (rgbColor == Colors.Red) lastDesktopInkColor = 1;
else if (rgbColor == Colors.Green || rgbColor == Color.FromRgb(22, 163, 74)) lastDesktopInkColor = 2;
else if (rgbColor == Color.FromRgb(147, 51, 234)) lastDesktopInkColor = 6;
}
else
{
if (rgbColor == Colors.White) lastBoardInkColor = 5;
else if (rgbColor == Color.FromRgb(251, 150, 80)) lastBoardInkColor = 8;
else if (rgbColor == Colors.Yellow) lastBoardInkColor = 4;
else if (rgbColor == Colors.Black) lastBoardInkColor = 0;
else if (rgbColor == Color.FromRgb(37, 99, 235)) lastBoardInkColor = 3;
else if (rgbColor == Colors.Red) lastBoardInkColor = 1;
else if (rgbColor == Colors.Green || rgbColor == Color.FromRgb(22, 163, 74)) lastBoardInkColor = 2;
else if (rgbColor == Color.FromRgb(147, 51, 234)) lastBoardInkColor = 6;
}
var colorWithAlpha = Color.FromArgb(color.A, color.R, color.G, color.B);
@@ -1123,7 +1097,6 @@ namespace Ink_Canvas
inkCanvas1.EditingMode == InkCanvasEditingMode.Select ||
drawingShapeMode != 0)
inkCanvas1.ForceCursor = true;
else
inkCanvas1.ForceCursor = false;
}
else
@@ -1200,7 +1173,7 @@ namespace Ink_Canvas
// 检查保存路径是否可用,不可用则修正
try
{
string savePath = Settings.Automation.AutoSavedStrokesLocation;
var savePath = Settings.Automation.AutoSavedStrokesLocation;
bool needFix = false;
if (string.IsNullOrWhiteSpace(savePath) || !Directory.Exists(savePath))
{
@@ -1223,7 +1196,6 @@ namespace Ink_Canvas
if (needFix)
{
string newPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Saves");
Settings.Automation.AutoSavedStrokesLocation = newPath;
if (!Directory.Exists(newPath))
Directory.CreateDirectory(newPath);
SaveSettingsToFile();
@@ -1338,9 +1310,6 @@ namespace Ink_Canvas
// 恢复崩溃后操作设置
if (App.CrashAction == App.CrashActionType.SilentRestart)
RadioCrashSilentRestart.IsChecked = true;
else
RadioCrashNoAction.IsChecked = true;
// 显示快抽悬浮按钮
ShowQuickDrawFloatingButton();
@@ -1448,12 +1417,7 @@ namespace Ink_Canvas
BtnPPTSlideShowEnd.Visibility == Visibility.Visible &&
PPTTimeCapsule != null)
{
MinimizedTimerContainer.Visibility = Visibility.Collapsed;
}
else
{
MinimizedTimerContainer.Visibility = Visibility.Visible;
MinimizedTimerControl.Visibility = Visibility.Visible;
PPTTimeCapsule.Visibility = Visibility.Collapsed;
}
}
};
@@ -1493,7 +1457,6 @@ namespace Ink_Canvas
{
try
{
if (ComboBoxLanguage == null || Settings?.Appearance == null) return;
var preferredLanguage = Settings.Appearance.Language ?? string.Empty;
int index;
@@ -1518,7 +1481,6 @@ namespace Ink_Canvas
_isApplyingLanguageFromSettings = true;
try
{
ComboBoxLanguage.SelectedIndex = index;
}
finally
{
@@ -1555,7 +1517,6 @@ namespace Ink_Canvas
if (!isFloatingBarFolded)
{
if (isInPPTPresentationMode) ViewboxFloatingBarMarginAnimation(60);
else ViewboxFloatingBarMarginAnimation(100, true);
}
});
}).Start();
@@ -1593,7 +1554,6 @@ namespace Ink_Canvas
if (!isFloatingBarFolded)
{
if (isInPPTPresentationMode) ViewboxFloatingBarMarginAnimation(60);
else ViewboxFloatingBarMarginAnimation(100, true);
}
});
}).Start();
@@ -2125,12 +2085,10 @@ namespace Ink_Canvas
// 新增:崩溃后操作设置按钮事件
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
{
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
{
App.CrashAction = App.CrashActionType.SilentRestart;
Settings.Startup.CrashAction = 0;
}
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
{
App.CrashAction = App.CrashActionType.NoAction;
Settings.Startup.CrashAction = 1;
@@ -2434,28 +2392,21 @@ namespace Ink_Canvas
switch (sectionTag.ToLower())
{
case "startup":
targetGroupBox = GroupBoxStartup;
break;
case "gesture":
targetGroupBox = GroupBoxGesture;
break;
case "crashaction":
targetGroupBox = GroupBoxCrashAction;
break;
case "ppt":
targetGroupBox = GroupBoxPPT;
break;
case "advanced":
targetGroupBox = GroupBoxAdvanced;
break;
case "automation":
targetGroupBox = GroupBoxAutomation;
break;
case "randomwindow":
targetGroupBox = GroupBoxRandWindow;
break;
case "theme":
targetGroupBox = GroupBoxAppearanceNewUI;
break;
case "shortcuts":
// 快捷键设置部分可能尚未实现
@@ -3223,9 +3174,7 @@ namespace Ink_Canvas
try
{
if (!isLoaded) return;
if (ComboBoxPPTTimeCapsulePosition != null)
{
Settings.PowerPointSettings.PPTTimeCapsulePosition = ComboBoxPPTTimeCapsulePosition.SelectedIndex;
SaveSettingsToFile();
// 如果当前在PPT放映模式,需要立即更新时间胶囊的位置
@@ -3234,7 +3183,6 @@ namespace Ink_Canvas
UpdatePPTTimeCapsulePosition();
}
LogHelper.WriteLogToFile($"PPT时间胶囊位置已更改为: {ComboBoxPPTTimeCapsulePosition.SelectedIndex}", LogHelper.LogType.Event);
}
}
catch (Exception ex)
@@ -3280,11 +3228,12 @@ namespace Ink_Canvas
BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
{
PPTTimeCapsuleContainer.Visibility = Visibility.Visible;
UpdatePPTTimeCapsulePosition();
PPTTimeCapsule.Visibility = Visibility.Visible;
}
else
{
PPTTimeCapsuleContainer.Visibility = Visibility.Collapsed;
PPTTimeCapsule.Visibility = Visibility.Collapsed;
}
}
catch (Exception ex)
@@ -3369,19 +3318,13 @@ namespace Ink_Canvas
bool isRegistered = FileAssociationManager.IsFileAssociationRegistered();
if (isRegistered)
{
TextBlockFileAssociationStatus.Text = "✓ .icstk文件关联已注册";
TextBlockFileAssociationStatus.Foreground = new SolidColorBrush(Colors.LightGreen);
}
else
{
TextBlockFileAssociationStatus.Text = "✗ .icstk文件关联未注册";
TextBlockFileAssociationStatus.Foreground = new SolidColorBrush(Colors.LightCoral);
}
}
catch (Exception ex)
{
TextBlockFileAssociationStatus.Text = "✗ 检查文件关联状态时出错";
TextBlockFileAssociationStatus.Foreground = new SolidColorBrush(Colors.LightCoral);
LogHelper.WriteLogToFile($"初始化文件关联状态显示时出错: {ex.Message}", LogHelper.LogType.Error);
}
}
@@ -3484,21 +3427,6 @@ namespace Ink_Canvas
// 获取所有滑块控件并添加触摸支持
var sliders = new List<Slider>
{
ViewboxFloatingBarScaleTransformValueSlider,
ViewboxFloatingBarOpacityValueSlider,
ViewboxFloatingBarOpacityInPPTValueSlider,
PPTButtonLeftPositionValueSlider,
PPTButtonRightPositionValueSlider,
PPTButtonLBPositionValueSlider,
PPTButtonRBPositionValueSlider,
PPTLSButtonOpacityValueSlider,
PPTRSButtonOpacityValueSlider,
PPTLBButtonOpacityValueSlider,
PPTRBButtonOpacityValueSlider,
TouchMultiplierSlider,
NibModeBoundsWidthSlider,
FingerModeBoundsWidthSlider,
SideControlMinimumAutomationSlider,
RandWindowOnceCloseLatencySlider,
RandWindowOnceMaxStudentsSlider,
TimerVolumeSlider,
@@ -3919,12 +3847,10 @@ namespace Ink_Canvas
if (_isApplyingLanguageFromSettings) return;
if (_isReloadingForLanguageChange) return;
if (Settings?.Appearance == null) return;
if (ComboBoxLanguage == null) return;
var index = ComboBoxLanguage.SelectedIndex;
string language;
switch (index)
switch ((sender as System.Windows.Controls.ComboBox)?.SelectedIndex ?? -1)
{
case 1:
language = "zh-CN";
-4
View File
@@ -284,10 +284,6 @@ namespace Ink_Canvas
{
try
{
if (ComboBoxFloatingBarImg != null)
{
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
}
}
catch (Exception)
{
@@ -47,7 +47,6 @@ namespace Ink_Canvas
if (!isLoaded) return;
// 设置主开关状态
ToggleSwitchFloatingWindowInterceptorEnabled.IsOn = Settings.Automation.FloatingWindowInterceptor.IsEnabled;
// 设置各个拦截规则的状态
foreach (var kvp in Settings.Automation.FloatingWindowInterceptor.InterceptRules)
@@ -77,7 +76,6 @@ namespace Ink_Canvas
try
{
var isEnabled = Settings.Automation.FloatingWindowInterceptor.IsEnabled;
FloatingWindowInterceptorGrid.Visibility = isEnabled ? Visibility.Visible : Visibility.Collapsed;
// 计算启用的规则数量
var enabledRulesCount = Settings.Automation.FloatingWindowInterceptor.InterceptRules.Where(kvp => kvp.Value).Count();
@@ -87,13 +85,9 @@ namespace Ink_Canvas
if (_floatingWindowInterceptorManager != null)
{
var stats = _floatingWindowInterceptorManager.GetStatistics();
TextBlockFloatingWindowInterceptorStatus.Text = stats.IsRunning
? $"拦截器运行中 - 已启用 {enabledRulesCount}/{totalRulesCount} 个规则"
: $"拦截器未启动 - 已启用 {enabledRulesCount}/{totalRulesCount} 个规则";
}
else
{
TextBlockFloatingWindowInterceptorStatus.Text = $"拦截器未初始化 - 已启用 {enabledRulesCount}/{totalRulesCount} 个规则";
}
}
catch (Exception ex)
@@ -153,7 +147,6 @@ namespace Ink_Canvas
try
{
Settings.Automation.FloatingWindowInterceptor.IsEnabled = ToggleSwitchFloatingWindowInterceptorEnabled.IsOn;
if (_floatingWindowInterceptorManager != null)
{
@@ -182,7 +175,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoWhiteboard3Floating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoWhiteboard3Floating, ToggleSwitchSeewoWhiteboard3Floating.IsOn);
}
/// <summary>
@@ -191,7 +183,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoWhiteboard5Floating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoWhiteboard5Floating, ToggleSwitchSeewoWhiteboard5Floating.IsOn);
}
/// <summary>
@@ -200,7 +191,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoWhiteboard5CFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoWhiteboard5CFloating, ToggleSwitchSeewoWhiteboard5CFloating.IsOn);
}
/// <summary>
@@ -209,7 +199,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoPincoSideBarFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoPincoSideBarFloating, ToggleSwitchSeewoPincoSideBarFloating.IsOn);
}
/// <summary>
@@ -218,7 +207,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoPincoDrawingFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoPincoDrawingFloating, ToggleSwitchSeewoPincoDrawingFloating.IsOn);
}
/// <summary>
@@ -227,7 +215,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoPPTFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoPPTFloating, ToggleSwitchSeewoPPTFloating.IsOn);
}
/// <summary>
@@ -236,7 +223,6 @@ namespace Ink_Canvas
private void ToggleSwitchAiClassFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.AiClassFloating, ToggleSwitchAiClassFloating.IsOn);
}
/// <summary>
@@ -245,7 +231,6 @@ namespace Ink_Canvas
private void ToggleSwitchHiteAnnotationFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.HiteAnnotationFloating, ToggleSwitchHiteAnnotationFloating.IsOn);
}
/// <summary>
@@ -254,7 +239,6 @@ namespace Ink_Canvas
private void ToggleSwitchChangYanFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.ChangYanFloating, ToggleSwitchChangYanFloating.IsOn);
}
/// <summary>
@@ -263,7 +247,6 @@ namespace Ink_Canvas
private void ToggleSwitchChangYanPptFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.ChangYanPptFloating, ToggleSwitchChangYanPptFloating.IsOn);
}
/// <summary>
@@ -272,7 +255,6 @@ namespace Ink_Canvas
private void ToggleSwitchIntelligentClassFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.IntelligentClassFloating, ToggleSwitchIntelligentClassFloating.IsOn);
}
/// <summary>
@@ -281,7 +263,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoDesktopAnnotationFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoDesktopAnnotationFloating, ToggleSwitchSeewoDesktopAnnotationFloating.IsOn);
}
/// <summary>
@@ -290,7 +271,6 @@ namespace Ink_Canvas
private void ToggleSwitchSeewoDesktopSideBarFloating_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
SetInterceptRule(FloatingWindowInterceptor.InterceptType.SeewoDesktopSideBarFloating, ToggleSwitchSeewoDesktopSideBarFloating.IsOn);
}
/// <summary>
+3 -9
View File
@@ -2021,14 +2021,12 @@ namespace Ink_Canvas
{
if (!isLoaded) return;
Settings.PowerPointSettings.EnablePowerPointEnhancement = ToggleSwitchPowerPointEnhancement.IsOn;
Settings.PowerPointSettings.EnablePowerPointEnhancement = true;
if (Settings.PowerPointSettings.EnablePowerPointEnhancement)
{
Settings.PowerPointSettings.IsSupportWPS = false;
ToggleSwitchSupportWPS.IsOn = false;
// 更新PPT管理器的WPS支持设置
if (_pptManager != null)
{
_pptManager.IsSupportWPS = false;
@@ -2037,7 +2035,6 @@ namespace Ink_Canvas
SaveSettingsToFile();
// 启动或停止PowerPoint进程守护
if (Settings.PowerPointSettings.EnablePowerPointEnhancement)
{
StartPowerPointProcessMonitoring();
@@ -2066,16 +2063,14 @@ namespace Ink_Canvas
{
if (!isLoaded) return;
Settings.PowerPointSettings.IsSupportWPS = ToggleSwitchSupportWPS.IsOn;
Settings.PowerPointSettings.IsSupportWPS = true;
if (Settings.PowerPointSettings.IsSupportWPS)
{
if (!Settings.PowerPointSettings.PowerPointSupport)
{
Settings.PowerPointSettings.PowerPointSupport = true;
ToggleSwitchSupportPowerPoint.IsOn = true;
// 启动PPT监控
if (_pptManager == null)
{
InitializePPTManagers();
@@ -2086,7 +2081,6 @@ namespace Ink_Canvas
if (Settings.PowerPointSettings.EnablePowerPointEnhancement)
{
Settings.PowerPointSettings.EnablePowerPointEnhancement = false;
ToggleSwitchPowerPointEnhancement.IsOn = false;
StopPowerPointProcessMonitoring();
}
}
@@ -2105,7 +2099,7 @@ namespace Ink_Canvas
{
if (!isLoaded) return;
Settings.PowerPointSettings.SkipAnimationsWhenGoNext = ToggleSwitchSkipAnimationsWhenGoNext.IsOn;
Settings.PowerPointSettings.SkipAnimationsWhenGoNext = true;
if (_pptManager != null)
{
File diff suppressed because it is too large Load Diff
+6 -260
View File
@@ -1,4 +1,4 @@
using H.NotifyIcon;
using H.NotifyIcon;
using Ink_Canvas.Helpers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -195,8 +195,7 @@ namespace Ink_Canvas
{
if (Settings.Automation.AutoDelSavedFiles)
{
DelAutoSavedFiles.DeleteFilesOlder(Settings.Automation.AutoSavedStrokesLocation,
Settings.Automation.AutoDelSavedFilesDaysThreshold);
DelAutoSavedFiles.DeleteFilesOlder(Settings.Automation.AutoSavedStrokesLocation, Settings.Automation.AutoDelSavedFilesDaysThreshold);
}
}
@@ -244,12 +243,10 @@ namespace Ink_Canvas
if (Settings.Startup.CrashAction == 0)
{
App.CrashAction = App.CrashActionType.SilentRestart;
if (RadioCrashSilentRestart != null) RadioCrashSilentRestart.IsChecked = true;
}
else
{
App.CrashAction = App.CrashActionType.NoAction;
if (RadioCrashNoAction != null) RadioCrashNoAction.IsChecked = true;
}
}
@@ -298,10 +295,8 @@ namespace Ink_Canvas
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleY =
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransformValueSlider.Value = val;
}
ComboBoxUnFoldBtnImg.SelectedIndex = Settings.Appearance.UnFoldButtonImageType;
switch (Settings.Appearance.UnFoldButtonImageType)
{
case 0:
@@ -331,12 +326,10 @@ namespace Ink_Canvas
}
// 设置主题下拉框
ComboBoxTheme.SelectedIndex = Settings.Appearance.Theme;
_suppressChickenSoupSourceSelectionChanged = true;
try
{
ComboBoxChickenSoupSource.SelectedIndex = Settings.Appearance.ChickenSoupSource;
}
finally
{
@@ -345,32 +338,12 @@ namespace Ink_Canvas
DispatcherPriority.ContextIdle);
}
// 初始化自定义按钮的可见性(仅在选择API时显示)
if (BtnHitokotoCustomize != null)
{
BtnHitokotoCustomize.Visibility = Settings.Appearance.ChickenSoupSource == 3
? Visibility.Visible
: Visibility.Collapsed;
}
ToggleSwitchEnableQuickPanel.IsOn = Settings.Appearance.IsShowQuickPanel;
ToggleSwitchEnableSplashScreen.IsOn = Settings.Appearance.EnableSplashScreen;
ComboBoxSplashScreenStyle.SelectedIndex = Settings.Appearance.SplashScreenStyle;
ToggleSwitchEnableTrayIcon.IsOn = Settings.Appearance.EnableTrayIcon;
ICCTrayIconExampleImage.Visibility =
Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
var _taskbar = (TaskbarIcon)Application.Current.Resources["TaskbarTrayIcon"];
_taskbar.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
ViewboxFloatingBar.Opacity = Settings.Appearance.ViewboxFloatingBarOpacityValue;
// 初始化浮动栏透明度滑块值
ViewboxFloatingBarOpacityValueSlider.Value = Settings.Appearance.ViewboxFloatingBarOpacityValue;
ViewboxFloatingBarOpacityInPPTValueSlider.Value = Settings.Appearance.ViewboxFloatingBarOpacityInPPTValue;
if (Settings.Appearance.EnableViewboxBlackBoardScaleTransform) // 画板 UI 缩放 80%
{
@@ -381,7 +354,6 @@ namespace Ink_Canvas
//ViewboxBlackboardRightSideScaleTransform.ScaleX = 0.8;
//ViewboxBlackboardRightSideScaleTransform.ScaleY = 0.8;
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = true;
}
else
{
@@ -392,7 +364,6 @@ namespace Ink_Canvas
//ViewboxBlackboardRightSideScaleTransform.ScaleX = 1;
//ViewboxBlackboardRightSideScaleTransform.ScaleY = 1;
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = false;
}
if (Settings.Appearance.IsTransparentButtonBackground)
@@ -414,35 +385,15 @@ namespace Ink_Canvas
// 设置选中的图标索引
// 如果索引超出范围(自定义图标可能已删除),使用默认图标
if (Settings.Appearance.FloatingBarImg >= ComboBoxFloatingBarImg.Items.Count)
{
Settings.Appearance.FloatingBarImg = 0;
}
ComboBoxFloatingBarImg.SelectedIndex = Settings.Appearance.FloatingBarImg;
// 更新浮动栏图标
UpdateFloatingBarIcon();
ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn =
Settings.Appearance.EnableTimeDisplayInWhiteboardMode;
ToggleSwitchEnableChickenSoupInWhiteboardMode.IsOn =
Settings.Appearance.EnableChickenSoupInWhiteboardMode;
// 浮动栏按钮显示控制开关初始化
CheckBoxUseLegacyFloatingBarUI.IsChecked = Settings.Appearance.UseLegacyFloatingBarUI;
CheckBoxShowShapeButton.IsChecked = Settings.Appearance.IsShowShapeButton;
CheckBoxShowUndoButton.IsChecked = Settings.Appearance.IsShowUndoButton;
CheckBoxShowRedoButton.IsChecked = Settings.Appearance.IsShowRedoButton;
CheckBoxShowClearButton.IsChecked = Settings.Appearance.IsShowClearButton;
CheckBoxShowWhiteboardButton.IsChecked = Settings.Appearance.IsShowWhiteboardButton;
CheckBoxShowHideButton.IsChecked = Settings.Appearance.IsShowHideButton;
CheckBoxShowQuickColorPalette.IsChecked = Settings.Appearance.IsShowQuickColorPalette;
CheckBoxShowLassoSelectButton.IsChecked = Settings.Appearance.IsShowLassoSelectButton;
CheckBoxShowClearAndMouseButton.IsChecked = Settings.Appearance.IsShowClearAndMouseButton;
ComboBoxEraserDisplayOption.SelectedIndex = Settings.Appearance.EraserDisplayOption;
ComboBoxQuickColorPaletteDisplayMode.SelectedIndex = Settings.Appearance.QuickColorPaletteDisplayMode;
// 初始化快捷调色盘指示器
UpdateQuickColorPaletteIndicator(inkCanvas.DefaultDrawingAttributes.Color);
@@ -467,78 +418,33 @@ namespace Ink_Canvas
if (Settings.PowerPointSettings.PowerPointSupport)
{
ToggleSwitchSupportPowerPoint.IsOn = true;
// PPT监控将在Window_Loaded中启动
}
else
{
ToggleSwitchSupportPowerPoint.IsOn = false;
// PPT监控将保持停止状态
}
ToggleSwitchShowCanvasAtNewSlideShow.IsOn = Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow;
if (ToggleSwitchUseRotPptLink != null)
{
ToggleSwitchUseRotPptLink.IsOn = Settings.PowerPointSettings.UseRotPptLink;
}
ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn =
Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode;
ToggleSwitchEnableFingerGestureSlideShowControl.IsOn =
Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl;
ToggleSwitchAutoSaveStrokesInPowerPoint.IsOn =
Settings.PowerPointSettings.IsAutoSaveStrokesInPowerPoint;
ToggleSwitchNotifyPreviousPage.IsOn = Settings.PowerPointSettings.IsNotifyPreviousPage;
// PPT时间显示胶囊设置
if (ToggleSwitchEnablePPTTimeCapsule != null)
{
ToggleSwitchEnablePPTTimeCapsule.IsOn = Settings.PowerPointSettings.EnablePPTTimeCapsule;
}
if (ComboBoxPPTTimeCapsulePosition != null)
{
int position = Settings.PowerPointSettings.PPTTimeCapsulePosition;
if (position < 0 || position > 2)
{
position = 1; // 默认右上角
position = 1;
}
ComboBoxPPTTimeCapsulePosition.SelectedIndex = position;
}
if (ToggleSwitchShowPPTSidebarByDefault != null)
{
ToggleSwitchShowPPTSidebarByDefault.IsOn = Settings.PowerPointSettings.ShowPPTSidebarByDefault;
}
// -- new --
ToggleSwitchShowPPTButton.IsOn = Settings.PowerPointSettings.ShowPPTButton;
ToggleSwitchEnablePPTButtonPageClickable.IsOn =
Settings.PowerPointSettings.EnablePPTButtonPageClickable;
ToggleSwitchEnablePPTButtonLongPressPageTurn.IsOn =
Settings.PowerPointSettings.EnablePPTButtonLongPressPageTurn;
var dops = Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
var dopsc = dops.ToCharArray();
if ((dopsc[0] == '1' || dopsc[0] == '2') && (dopsc[1] == '1' || dopsc[1] == '2') &&
(dopsc[2] == '1' || dopsc[2] == '2') && (dopsc[3] == '1' || dopsc[3] == '2'))
{
CheckboxEnableLBPPTButton.IsChecked = dopsc[0] == '2';
CheckboxEnableRBPPTButton.IsChecked = dopsc[1] == '2';
CheckboxEnableLSPPTButton.IsChecked = dopsc[2] == '2';
CheckboxEnableRSPPTButton.IsChecked = dopsc[3] == '2';
}
else
{
Settings.PowerPointSettings.PPTButtonsDisplayOption = 2222;
CheckboxEnableLBPPTButton.IsChecked = true;
CheckboxEnableRBPPTButton.IsChecked = true;
CheckboxEnableLSPPTButton.IsChecked = true;
CheckboxEnableRSPPTButton.IsChecked = true;
SaveSettingsToFile();
}
@@ -547,16 +453,10 @@ namespace Ink_Canvas
if ((sopsc[0] == '1' || sopsc[0] == '2') && (sopsc[1] == '1' || sopsc[1] == '2') &&
(sopsc[2] == '1' || sopsc[2] == '2'))
{
CheckboxSPPTDisplayPage.IsChecked = sopsc[0] == '2';
CheckboxSPPTHalfOpacity.IsChecked = sopsc[1] == '2';
CheckboxSPPTBlackBackground.IsChecked = sopsc[2] == '2';
}
else
{
Settings.PowerPointSettings.PPTSButtonsOption = 221;
CheckboxSPPTDisplayPage.IsChecked = true;
CheckboxSPPTHalfOpacity.IsChecked = true;
CheckboxSPPTBlackBackground.IsChecked = false;
SaveSettingsToFile();
}
@@ -565,26 +465,16 @@ namespace Ink_Canvas
if ((bopsc[0] == '1' || bopsc[0] == '2') && (bopsc[1] == '1' || bopsc[1] == '2') &&
(bopsc[2] == '1' || bopsc[2] == '2'))
{
CheckboxBPPTDisplayPage.IsChecked = bopsc[0] == '2';
CheckboxBPPTHalfOpacity.IsChecked = bopsc[1] == '2';
CheckboxBPPTBlackBackground.IsChecked = bopsc[2] == '2';
}
else
{
Settings.PowerPointSettings.PPTBButtonsOption = 121;
CheckboxBPPTDisplayPage.IsChecked = false;
CheckboxBPPTHalfOpacity.IsChecked = true;
CheckboxBPPTBlackBackground.IsChecked = false;
SaveSettingsToFile();
}
PPTButtonLeftPositionValueSlider.Value = Settings.PowerPointSettings.PPTLSButtonPosition;
PPTButtonRightPositionValueSlider.Value = Settings.PowerPointSettings.PPTRSButtonPosition;
PPTButtonLBPositionValueSlider.Value = Settings.PowerPointSettings.PPTLBButtonPosition;
PPTButtonRBPositionValueSlider.Value = Settings.PowerPointSettings.PPTRBButtonPosition;
// 初始化PPT翻页按钮透明度滑块值,根据半透明选项设置默认值
// 重用之前定义的sopsc和bopsc变量
@@ -600,8 +490,6 @@ namespace Ink_Canvas
{
Settings.PowerPointSettings.PPTRSButtonOpacity = isSideHalfOpacity ? 0.5 : 1.0;
}
PPTLSButtonOpacityValueSlider.Value = Settings.PowerPointSettings.PPTLSButtonOpacity;
PPTRSButtonOpacityValueSlider.Value = Settings.PowerPointSettings.PPTRSButtonOpacity;
bool isBottomHalfOpacity = bopsc.Length >= 2 && bopsc[1] == '2';
// 如果透明度为0或未设置,根据半透明选项设置默认值
@@ -615,8 +503,6 @@ namespace Ink_Canvas
{
Settings.PowerPointSettings.PPTRBButtonOpacity = isBottomHalfOpacity ? 0.5 : 1.0;
}
PPTLBButtonOpacityValueSlider.Value = Settings.PowerPointSettings.PPTLBButtonOpacity;
PPTRBButtonOpacityValueSlider.Value = Settings.PowerPointSettings.PPTRBButtonOpacity;
UpdatePPTBtnSlidersStatus();
@@ -624,20 +510,6 @@ namespace Ink_Canvas
// -- new --
ToggleSwitchNotifyHiddenPage.IsOn = Settings.PowerPointSettings.IsNotifyHiddenPage;
ToggleSwitchNotifyAutoPlayPresentation.IsOn = Settings.PowerPointSettings.IsNotifyAutoPlayPresentation;
ToggleSwitchSupportWPS.IsOn = Settings.PowerPointSettings.IsSupportWPS;
ToggleSwitchSkipAnimationsWhenGoNext.IsOn = Settings.PowerPointSettings.SkipAnimationsWhenGoNext;
ToggleSwitchPowerPointEnhancement.IsOn = Settings.PowerPointSettings.EnablePowerPointEnhancement;
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn =
Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint;
ToggleSwitchEnableWppProcessKill.IsOn = Settings.PowerPointSettings.EnableWppProcessKill;
ToggleSwitchAlwaysGoToFirstPageOnReenter.IsOn = Settings.PowerPointSettings.IsAlwaysGoToFirstPageOnReenter;
}
else
{
@@ -647,39 +519,15 @@ namespace Ink_Canvas
// Gesture
if (Settings.Gesture != null)
{
ToggleSwitchEnableMultiTouchMode.IsOn = Settings.Gesture.IsEnableMultiTouchMode;
ToggleSwitchEnableTwoFingerZoom.IsOn = Settings.Gesture.IsEnableTwoFingerZoom;
BoardToggleSwitchEnableTwoFingerZoom.IsOn = Settings.Gesture.IsEnableTwoFingerZoom;
ToggleSwitchEnableTwoFingerTranslate.IsOn = Settings.Gesture.IsEnableTwoFingerTranslate;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = Settings.Gesture.IsEnableTwoFingerTranslate;
ToggleSwitchEnableTwoFingerRotation.IsOn = Settings.Gesture.IsEnableTwoFingerRotation;
BoardToggleSwitchEnableTwoFingerRotation.IsOn = Settings.Gesture.IsEnableTwoFingerRotation;
ToggleSwitchAutoSwitchTwoFingerGesture.IsOn = Settings.Gesture.AutoSwitchTwoFingerGesture;
ToggleSwitchEnableTwoFingerRotation.IsOn = Settings.Gesture.IsEnableTwoFingerRotation;
ToggleSwitchEnableTwoFingerRotationOnSelection.IsOn =
Settings.Gesture.IsEnableTwoFingerRotationOnSelection;
if (Settings.Gesture.AutoSwitchTwoFingerGesture)
{
if (Topmost)
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = false;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = false;
Settings.Gesture.IsEnableTwoFingerTranslate = false;
// if (!isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = true;
}
else
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = true;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = true;
Settings.Gesture.IsEnableTwoFingerTranslate = true;
if (isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = false;
}
}
@@ -858,41 +706,11 @@ namespace Ink_Canvas
// Palm Eraser
if (Settings.Canvas != null)
{
ToggleSwitchEnablePalmEraser.IsOn = Settings.Canvas.EnablePalmEraser;
ComboBoxPalmEraserSensitivity.SelectedIndex = Settings.Canvas.PalmEraserSensitivity;
}
// Advanced
if (Settings.Advanced != null)
{
TouchMultiplierSlider.Value = Settings.Advanced.TouchMultiplier;
FingerModeBoundsWidthSlider.Value = Settings.Advanced.FingerModeBoundsWidth;
NibModeBoundsWidthSlider.Value = Settings.Advanced.NibModeBoundsWidth;
ToggleSwitchIsLogEnabled.IsOn = Settings.Advanced.IsLogEnabled;
ToggleSwitchIsSaveLogByDate.IsOn = Settings.Advanced.IsSaveLogByDate;
ToggleSwitchIsSecondConfimeWhenShutdownApp.IsOn = Settings.Advanced.IsSecondConfirmWhenShutdownApp;
ToggleSwitchIsSpecialScreen.IsOn = Settings.Advanced.IsSpecialScreen;
ToggleSwitchIsEnableUriScheme.IsOn = Settings.Advanced.IsEnableUriScheme;
ToggleSwitchIsQuadIR.IsOn = Settings.Advanced.IsQuadIR;
ToggleSwitchEraserBindTouchMultiplier.IsOn = Settings.Advanced.EraserBindTouchMultiplier;
ToggleSwitchIsEnableFullScreenHelper.IsOn = Settings.Advanced.IsEnableFullScreenHelper;
ToggleSwitchIsEnableEdgeGestureUtil.IsOn = Settings.Advanced.IsEnableEdgeGestureUtil;
ToggleSwitchIsEnableForceFullScreen.IsOn = Settings.Advanced.IsEnableForceFullScreen;
ToggleSwitchIsEnableResolutionChangeDetection.IsOn = Settings.Advanced.IsEnableResolutionChangeDetection;
ToggleSwitchIsEnableDPIChangeDetection.IsOn = Settings.Advanced.IsEnableDPIChangeDetection;
ToggleSwitchIsEnableAvoidFullScreenHelper.IsOn = Settings.Advanced.IsEnableAvoidFullScreenHelper;
ToggleSwitchIsAutoBackupBeforeUpdate.IsOn = Settings.Advanced.IsAutoBackupBeforeUpdate;
ToggleSwitchIsAutoBackupEnabled.IsOn = Settings.Advanced.IsAutoBackupEnabled;
// 设置备份间隔下拉框
foreach (ComboBoxItem item in ComboBoxAutoBackupInterval.Items)
{
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out int interval) && interval == Settings.Advanced.AutoBackupIntervalDays)
{
ComboBoxAutoBackupInterval.SelectedItem = item;
break;
}
}
if (Settings.Advanced.IsEnableFullScreenHelper)
{
FullScreenHelper.MarkFullscreenWindowTaskbarList(new WindowInteropHelper(this).Handle, true);
@@ -914,8 +732,7 @@ namespace Ink_Canvas
if (OSVersion.GetOperatingSystem() >= OperatingSystem.Windows10)
EdgeGestureUtil.DisableEdgeGestures(new WindowInteropHelper(this).Handle, true);
}
TouchMultiplierSlider.Visibility =
ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
}
else
{
@@ -1037,54 +854,30 @@ namespace Ink_Canvas
if (Settings.Automation != null)
{
StartOrStoptimerCheckAutoFold();
ToggleSwitchAutoFoldInEasiNote.IsOn = Settings.Automation.IsAutoFoldInEasiNote;
ToggleSwitchAutoFoldInEasiCamera.IsOn = Settings.Automation.IsAutoFoldInEasiCamera;
ToggleSwitchAutoFoldInEasiNote3C.IsOn = Settings.Automation.IsAutoFoldInEasiNote3C;
ToggleSwitchAutoFoldInEasiNote3.IsOn = Settings.Automation.IsAutoFoldInEasiNote3;
ToggleSwitchAutoFoldInEasiNote5C.IsOn = Settings.Automation.IsAutoFoldInEasiNote5C;
ToggleSwitchAutoFoldInSeewoPincoTeacher.IsOn = Settings.Automation.IsAutoFoldInSeewoPincoTeacher;
ToggleSwitchAutoFoldInHiteTouchPro.IsOn = Settings.Automation.IsAutoFoldInHiteTouchPro;
ToggleSwitchAutoFoldInHiteLightBoard.IsOn = Settings.Automation.IsAutoFoldInHiteLightBoard;
ToggleSwitchAutoFoldInHiteCamera.IsOn = Settings.Automation.IsAutoFoldInHiteCamera;
ToggleSwitchAutoFoldInWxBoardMain.IsOn = Settings.Automation.IsAutoFoldInWxBoardMain;
ToggleSwitchAutoFoldInOldZyBoard.IsOn = Settings.Automation.IsAutoFoldInOldZyBoard;
ToggleSwitchAutoFoldInMSWhiteboard.IsOn = Settings.Automation.IsAutoFoldInMSWhiteboard;
ToggleSwitchAutoFoldInAdmoxWhiteboard.IsOn = Settings.Automation.IsAutoFoldInAdmoxWhiteboard;
ToggleSwitchAutoFoldInAdmoxBooth.IsOn = Settings.Automation.IsAutoFoldInAdmoxBooth;
ToggleSwitchAutoFoldInQPoint.IsOn = Settings.Automation.IsAutoFoldInQPoint;
ToggleSwitchAutoFoldInYiYunVisualPresenter.IsOn = Settings.Automation.IsAutoFoldInYiYunVisualPresenter;
ToggleSwitchAutoFoldInMaxHubWhiteboard.IsOn = Settings.Automation.IsAutoFoldInMaxHubWhiteboard;
SettingsPPTInkingAndAutoFoldExplictBorder.Visibility = Visibility.Collapsed;
if (Settings.Automation.IsAutoFoldInPPTSlideShow)
{
SettingsPPTInkingAndAutoFoldExplictBorder.Visibility = Visibility.Visible;
SettingsShowCanvasAtNewSlideShowStackPanel.Opacity = 0.5;
SettingsShowCanvasAtNewSlideShowStackPanel.IsHitTestVisible = false;
}
ToggleSwitchAutoFoldInPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldInPPTSlideShow;
ToggleSwitchAutoFoldAfterPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldAfterPPTSlideShow;
ToggleSwitchKeepFoldAfterSoftwareExit.IsOn = Settings.Automation.KeepFoldAfterSoftwareExit;
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService ||
Settings.Automation.IsAutoKillHiteAnnotation || Settings.Automation.IsAutoKillInkCanvas
@@ -1099,62 +892,15 @@ namespace Ink_Canvas
timerKillProcess.Stop();
}
ToggleSwitchAutoKillEasiNote.IsOn = Settings.Automation.IsAutoKillEasiNote;
ToggleSwitchAutoKillHiteAnnotation.IsOn = Settings.Automation.IsAutoKillHiteAnnotation;
ToggleSwitchAutoKillPptService.IsOn = Settings.Automation.IsAutoKillPptService;
ToggleSwitchAutoKillVComYouJiao.IsOn = Settings.Automation.IsAutoKillVComYouJiao;
ToggleSwitchAutoKillInkCanvas.IsOn = Settings.Automation.IsAutoKillInkCanvas;
ToggleSwitchAutoKillICA.IsOn = Settings.Automation.IsAutoKillICA;
ToggleSwitchAutoKillIDT.IsOn = Settings.Automation.IsAutoKillIDT;
ToggleSwitchAutoKillSeewoLauncher2DesktopAnnotation.IsOn =
Settings.Automation.IsAutoKillSeewoLauncher2DesktopAnnotation;
ToggleSwitchAutoSaveStrokesAtClear.IsOn = Settings.Automation.IsAutoSaveStrokesAtClear;
ToggleSwitchSaveScreenshotsInDateFolders.IsOn = Settings.Automation.IsSaveScreenshotsInDateFolders;
ToggleSwitchAutoSaveStrokesAtScreenshot.IsOn = Settings.Automation.IsAutoSaveStrokesAtScreenshot;
ToggleSwitchSaveFullPageStrokes.IsOn = Settings.Automation.IsSaveFullPageStrokes;
ToggleSwitchSaveStrokesAsXML.IsOn = Settings.Automation.IsSaveStrokesAsXML;
// 加载定时保存墨迹设置
ToggleSwitchEnableAutoSaveStrokes.IsOn = Settings.Automation.IsEnableAutoSaveStrokes;
// 初始化保存间隔下拉框
if (ComboBoxAutoSaveStrokesInterval != null)
if (Settings.Automation.AutoDelSavedFiles)
{
int intervalMinutes = Settings.Automation.AutoSaveStrokesIntervalMinutes;
if (intervalMinutes < 1) intervalMinutes = 5; // 默认5分钟
foreach (System.Windows.Controls.ComboBoxItem item in ComboBoxAutoSaveStrokesInterval.Items)
{
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out int tagValue) && tagValue == intervalMinutes)
{
ComboBoxAutoSaveStrokesInterval.SelectedItem = item;
break;
}
}
DelAutoSavedFiles.DeleteFilesOlder(Settings.Automation.AutoSavedStrokesLocation, Settings.Automation.AutoDelSavedFilesDaysThreshold);
}
SideControlMinimumAutomationSlider.Value = Settings.Automation.MinimumAutomationStrokeNumber;
AutoSavedStrokesLocation.Text = Settings.Automation.AutoSavedStrokesLocation;
ToggleSwitchAutoDelSavedFiles.IsOn = Settings.Automation.AutoDelSavedFiles;
ComboBoxAutoDelSavedFilesDaysThreshold.Text =
Settings.Automation.AutoDelSavedFilesDaysThreshold.ToString();
// 加载退出收纳模式自动切换至批注模式设置
ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode.IsOn = Settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode;
// 加载退出白板时自动收纳设置
ToggleSwitchAutoFoldWhenExitWhiteboard.IsOn = Settings.Automation.IsAutoFoldWhenExitWhiteboard;
}
else
{
+1 -5
View File
@@ -1,4 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -233,8 +233,6 @@ namespace Ink_Canvas
if (palmEraserWasEnabledBeforeMultiTouch)
{
Settings.Canvas.EnablePalmEraser = true;
if (ToggleSwitchEnablePalmEraser != null)
ToggleSwitchEnablePalmEraser.IsOn = true;
}
}
else
@@ -259,8 +257,6 @@ namespace Ink_Canvas
palmEraserWasEnabledBeforeMultiTouch = Settings.Canvas.EnablePalmEraser;
Settings.Canvas.EnablePalmEraser = false;
if (ToggleSwitchEnablePalmEraser != null)
ToggleSwitchEnablePalmEraser.IsOn = false;
}
}
+1 -2
View File
@@ -1,4 +1,4 @@
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
@@ -41,7 +41,6 @@ namespace Ink_Canvas
MainWindow.Settings.Appearance.FloatingBarImg - 12 >= MainWindow.Settings.Appearance.CustomFloatingBarImgs.Count)
{
MainWindow.Settings.Appearance.FloatingBarImg = 0;
mainWindow.ComboBoxFloatingBarImg.SelectedIndex = 0;
mainWindow.UpdateFloatingBarIcon();
}
@@ -0,0 +1,139 @@
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AdvancedPage"
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:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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>
<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="CardIsSpecialScreen"
Header="{i18n:I18n Key=Advanced_SpecialScreen}"
Icon="{x:Static ui:SegoeFluentIcons.TVMonitor}"
SwitchName="ToggleSwitchIsSpecialScreen"
Toggled="ToggleSwitchIsSpecialScreen_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableUriScheme"
Header="{i18n:I18n Key=Advanced_UriScheme}"
Icon="{x:Static ui:SegoeFluentIcons.Link}"
SwitchName="ToggleSwitchIsEnableUriScheme"
Toggled="ToggleSwitchIsEnableUriScheme_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsQuadIR"
Header="{i18n:I18n Key=Advanced_QuadIR}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchIsQuadIR"
Toggled="ToggleSwitchIsQuadIR_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEraserBindTouchMultiplier"
Header="{i18n:I18n Key=Advanced_EraserBindTouchMultiplier}"
Icon="{x:Static ui:SegoeFluentIcons.EraseTool}"
SwitchName="ToggleSwitchEraserBindTouchMultiplier"
Toggled="ToggleSwitchEraserBindTouchMultiplier_Toggled" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="全屏辅助" />
<controls:LabeledSettingsCard x:Name="CardIsEnableFullScreenHelper"
Header="{i18n:I18n Key=Advanced_FullScreenHelper}"
Icon="{x:Static ui:SegoeFluentIcons.FullScreen}"
SwitchName="ToggleSwitchIsEnableFullScreenHelper"
Toggled="ToggleSwitchIsEnableFullScreenHelper_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableAvoidFullScreenHelper"
Header="{i18n:I18n Key=Advanced_AvoidFullScreenHelper}"
Icon="{x:Static ui:SegoeFluentIcons.BackToWindow}"
SwitchName="ToggleSwitchIsEnableAvoidFullScreenHelper"
Toggled="ToggleSwitchIsEnableAvoidFullScreenHelper_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableEdgeGestureUtil"
Header="{i18n:I18n Key=Advanced_EdgeGesture}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchIsEnableEdgeGestureUtil"
Toggled="ToggleSwitchIsEnableEdgeGestureUtil_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableForceFullScreen"
Header="{i18n:I18n Key=Advanced_ForceFullScreen}"
Icon="{x:Static ui:SegoeFluentIcons.FullScreen}"
SwitchName="ToggleSwitchIsEnableForceFullScreen"
Toggled="ToggleSwitchIsEnableForceFullScreen_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableDPIChangeDetection"
Header="{i18n:I18n Key=Advanced_DPIDetection}"
Icon="{x:Static ui:SegoeFluentIcons.Zoom}"
SwitchName="ToggleSwitchIsEnableDPIChangeDetection"
Toggled="ToggleSwitchIsEnableDPIChangeDetection_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsEnableResolutionChangeDetection"
Header="{i18n:I18n Key=Advanced_ResolutionDetection}"
Icon="{x:Static ui:SegoeFluentIcons.TVMonitor}"
SwitchName="ToggleSwitchIsEnableResolutionChangeDetection"
Toggled="ToggleSwitchIsEnableResolutionChangeDetection_Toggled" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="日志与备份" />
<controls:LabeledSettingsCard x:Name="CardIsLogEnabled"
Header="{i18n:I18n Key=Advanced_EnableLog}"
Icon="{x:Static ui:SegoeFluentIcons.Document}"
SwitchName="ToggleSwitchIsLogEnabled"
Toggled="ToggleSwitchIsLogEnabled_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsSaveLogByDate"
Header="{i18n:I18n Key=Advanced_SaveLogByDate}"
Icon="{x:Static ui:SegoeFluentIcons.Calendar}"
SwitchName="ToggleSwitchIsSaveLogByDate"
Toggled="ToggleSwitchIsSaveLogByDate_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsSecondConfirmWhenShutdownApp"
Header="{i18n:I18n Key=Advanced_SecondConfirmShutdown}"
Icon="{x:Static ui:SegoeFluentIcons.Completed}"
SwitchName="ToggleSwitchIsSecondConfirmWhenShutdownApp"
Toggled="ToggleSwitchIsSecondConfirmWhenShutdownApp_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsAutoBackupBeforeUpdate"
Header="{i18n:I18n Key=Advanced_AutoBackupBeforeUpdate}"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
SwitchName="ToggleSwitchIsAutoBackupBeforeUpdate"
Toggled="ToggleSwitchIsAutoBackupBeforeUpdate_Toggled" />
<controls:LabeledSettingsCard x:Name="CardIsAutoBackupEnabled"
Header="{i18n:I18n Key=Advanced_AutoBackupEnabled}"
Icon="{x:Static ui:SegoeFluentIcons.SaveLocal}"
SwitchName="ToggleSwitchIsAutoBackupEnabled"
Toggled="ToggleSwitchIsAutoBackupEnabled_Toggled" />
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>
@@ -0,0 +1,148 @@
using Ink_Canvas.Windows.SettingsViews.Helpers;
using System;
using System.Diagnostics;
using System.Windows;
namespace Ink_Canvas.Windows.SettingsViews.Pages
{
public partial class AdvancedPage : iNKORE.UI.WPF.Modern.Controls.Page
{
private bool _isLoaded = false;
public AdvancedPage()
{
InitializeComponent();
Loaded += AdvancedPage_Loaded;
}
private void AdvancedPage_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
_isLoaded = true;
}
private void LoadSettings()
{
_isLoaded = false;
try
{
var settings = SettingsManager.Settings;
if (settings.Advanced != null)
{
CardIsSpecialScreen.IsOn = settings.Advanced.IsSpecialScreen;
CardIsEnableUriScheme.IsOn = settings.Advanced.IsEnableUriScheme;
CardIsQuadIR.IsOn = settings.Advanced.IsQuadIR;
CardEraserBindTouchMultiplier.IsOn = settings.Advanced.EraserBindTouchMultiplier;
CardIsEnableFullScreenHelper.IsOn = settings.Advanced.IsEnableFullScreenHelper;
CardIsEnableAvoidFullScreenHelper.IsOn = settings.Advanced.IsEnableAvoidFullScreenHelper;
CardIsEnableEdgeGestureUtil.IsOn = settings.Advanced.IsEnableEdgeGestureUtil;
CardIsEnableForceFullScreen.IsOn = settings.Advanced.IsEnableForceFullScreen;
CardIsEnableDPIChangeDetection.IsOn = settings.Advanced.IsEnableDPIChangeDetection;
CardIsEnableResolutionChangeDetection.IsOn = settings.Advanced.IsEnableResolutionChangeDetection;
CardIsLogEnabled.IsOn = settings.Advanced.IsLogEnabled;
CardIsSaveLogByDate.IsOn = settings.Advanced.IsSaveLogByDate;
CardIsSecondConfirmWhenShutdownApp.IsOn = settings.Advanced.IsSecondConfirmWhenShutdownApp;
CardIsAutoBackupBeforeUpdate.IsOn = settings.Advanced.IsAutoBackupBeforeUpdate;
CardIsAutoBackupEnabled.IsOn = settings.Advanced.IsAutoBackupEnabled;
}
}
catch (Exception ex)
{
Debug.WriteLine($"加载高级设置时出错: {ex.Message}");
}
_isLoaded = true;
}
private void ToggleSwitchIsSpecialScreen_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSpecialScreen", CardIsSpecialScreen.IsOn);
}
private void ToggleSwitchIsEnableUriScheme_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableUriScheme", CardIsEnableUriScheme.IsOn);
}
private void ToggleSwitchIsQuadIR_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsQuadIR", CardIsQuadIR.IsOn);
}
private void ToggleSwitchEraserBindTouchMultiplier_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEraserBindTouchMultiplier", CardEraserBindTouchMultiplier.IsOn);
}
private void ToggleSwitchIsEnableFullScreenHelper_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableFullScreenHelper", CardIsEnableFullScreenHelper.IsOn);
}
private void ToggleSwitchIsEnableAvoidFullScreenHelper_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableAvoidFullScreenHelper", CardIsEnableAvoidFullScreenHelper.IsOn);
}
private void ToggleSwitchIsEnableEdgeGestureUtil_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableEdgeGestureUtil", CardIsEnableEdgeGestureUtil.IsOn);
}
private void ToggleSwitchIsEnableForceFullScreen_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableForceFullScreen", CardIsEnableForceFullScreen.IsOn);
}
private void ToggleSwitchIsEnableDPIChangeDetection_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableDPIChangeDetection", CardIsEnableDPIChangeDetection.IsOn);
}
private void ToggleSwitchIsEnableResolutionChangeDetection_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableResolutionChangeDetection", CardIsEnableResolutionChangeDetection.IsOn);
}
private void ToggleSwitchIsLogEnabled_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsLogEnabled", CardIsLogEnabled.IsOn);
}
private void ToggleSwitchIsSaveLogByDate_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSaveLogByDate", CardIsSaveLogByDate.IsOn);
}
private void ToggleSwitchIsSecondConfirmWhenShutdownApp_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSecondConfimeWhenShutdownApp", CardIsSecondConfirmWhenShutdownApp.IsOn);
}
private void ToggleSwitchIsAutoBackupBeforeUpdate_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsAutoBackupBeforeUpdate", CardIsAutoBackupBeforeUpdate.IsOn);
}
private void ToggleSwitchIsAutoBackupEnabled_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsAutoBackupEnabled", CardIsAutoBackupEnabled.IsOn);
}
}
}
@@ -1,49 +1,294 @@
<Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AppearancePage"
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AppearancePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
xmlns:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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"
d:DesignHeight="450" d:DesignWidth="800"
Title="外观">
<Grid Margin="24">
<StackPanel>
<TextBlock Text="外观设置" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
<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}">
<ui:SettingsCard
Header="主题"
Description="点击跳转到主题设置页面"
IsClickEnabled="True"
Click="SettingsCard_Click">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
</ui:SettingsCard.HeaderIcon>
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Theme_GroupTitle}" />
<ui:SettingsCard
Header="颜色"
Description="点击跳转到颜色设置页面"
IsClickEnabled="True"
Click="SettingsCard_Click_1"
Margin="0,8,0,0">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
</ui:SettingsCard.HeaderIcon>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_Label}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxTheme"
SelectionChanged="ComboBoxTheme_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_Light}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Dark}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_System}" />
</ComboBox>
</ui:SettingsCard>
<ui:SettingsCard
Header="字体"
Description="点击跳转到字体设置页面"
IsClickEnabled="True"
Click="SettingsCard_Click_2"
Margin="0,8,0,0">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
</ui:SettingsCard.HeaderIcon>
</ui:SettingsCard>
</StackPanel>
</Grid>
</Page>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_LanguageLabel}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Globe}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxLanguage"
SelectionChanged="ComboBoxLanguage_SelectionChanged"
Width="160">
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_System}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_ChineseSimplified}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Language_English}" />
</ComboBox>
</ui:SettingsCard>
<TextBlock Text="{i18n:I18n Key=Theme_Language_RestartHint}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap" Margin="0,0,0,4" />
<controls:LabeledSettingsCard x:Name="CardEnableSplashScreen"
Header="{i18n:I18n Key=Theme_EnableSplash}"
Icon="{x:Static ui:SegoeFluentIcons.Photo}"
SwitchName="ToggleSwitchEnableSplashScreen"
Toggled="ToggleSwitchEnableSplashScreen_Toggled" />
<ui:SettingsCard Header="{i18n:I18n Key=Theme_SplashStyle}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.BrowsePhotos}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxSplashScreenStyle"
SelectionChanged="ComboBoxSplashScreenStyle_SelectionChanged"
Width="150">
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Random}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Seasonal}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Spring}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Summer}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Autumn}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Winter}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_Splash_Horse}" />
</ComboBox>
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Theme_FloatingBarIcon}" />
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarIcon}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Rename}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxFloatingBarImg"
SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDefault}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccNoShadow}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDark}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccDarkBreath}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccWhiteTransparent}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_IccBlackTransparent}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkCrossEye}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkAbused}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkSmile}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkUnderwear}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_CoolapkGreenHatDoge}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_FloatingIcon_TiebaEmoji}" />
</ComboBox>
</ui:SettingsCard>
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Spacing="8" Margin="0,4,0,0">
<Button x:Name="ButtonAddCustomIcon" Content="{i18n:I18n Key=Theme_Upload}"
Click="ButtonAddCustomIcon_Click" Padding="10,3"/>
<Button x:Name="ButtonManageCustomIcons" Content="{i18n:I18n Key=Theme_Manage}"
Click="ButtonManageCustomIcons_Click" Padding="10,3"/>
</ikw:SimpleStackPanel>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarScale}">
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Minimum="0.5"
Maximum="1.25" Width="168"
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
TickPlacement="None" AutoToolTipPlacement="None"
ValueChanged="ViewboxFloatingBarScaleTransformValueSlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarOpacity}">
<Slider x:Name="ViewboxFloatingBarOpacityValueSlider" Minimum="0.3"
Maximum="1" Width="168"
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
TickPlacement="None" AutoToolTipPlacement="None"
ValueChanged="ViewboxFloatingBarOpacityValueSlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_FloatingBarOpacityInPPT}">
<Slider x:Name="ViewboxFloatingBarOpacityInPPTValueSlider" Minimum="0.3"
Maximum="1" Width="168"
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05"
TickPlacement="None" AutoToolTipPlacement="None"
ValueChanged="ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged" />
</ui:SettingsCard>
<TextBlock Text="{i18n:I18n Key=Theme_FloatingBarOpacityInPPTHint}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap" Margin="0,0,0,4" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Theme_FloatingBarButtonsTitle}" />
<controls:LabeledSettingsCard x:Name="CardEnableDisPlayNibModeToggle"
Header="{i18n:I18n Key=Theme_ShowNibButton}"
Icon="{x:Static ui:SegoeFluentIcons.PenTips}"
SwitchName="ToggleSwitchEnableDisPlayNibModeToggle"
Toggled="ToggleSwitchEnableDisPlayNibModeToggle_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableViewboxBlackBoardScaleTransform"
Header="{i18n:I18n Key=Theme_BlackboardScale80}"
Icon="{x:Static ui:SegoeFluentIcons.FullScreen}"
SwitchName="ToggleSwitchEnableViewboxBlackBoardScaleTransform"
Toggled="ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableTimeDisplayInWhiteboardMode"
Header="{i18n:I18n Key=Theme_ShowTimeInWhiteboard}"
Icon="{x:Static ui:SegoeFluentIcons.DateTime}"
SwitchName="ToggleSwitchEnableTimeDisplayInWhiteboardMode"
Toggled="ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableChickenSoupInWhiteboardMode"
Header="{i18n:I18n Key=Theme_ShowQuoteInWhiteboard}"
Icon="{x:Static ui:SegoeFluentIcons.Message}"
SwitchName="ToggleSwitchEnableChickenSoupInWhiteboardMode"
Toggled="ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled" />
<ui:SettingsCard Header="{i18n:I18n Key=Theme_QuoteSource}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Bookmarks}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxChickenSoupSource"
Width="240"
SelectionChanged="ComboBoxChickenSoupSource_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_OsuQuotes}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Mottos}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_GaokaoBless}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuoteSource_Hitokoto}" />
</ComboBox>
</ui:SettingsCard>
<controls:LabeledSettingsCard x:Name="CardEnableQuickPanel"
Header="{i18n:I18n Key=Theme_EnableQuickPanel}"
Icon="{x:Static ui:SegoeFluentIcons.GridView}"
SwitchName="ToggleSwitchEnableQuickPanel"
Toggled="ToggleSwitchEnableQuickPanel_Toggled" />
<ui:SettingsCard Header="{i18n:I18n Key=Theme_UnfoldButtonIcon}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChevronLeft}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxUnFoldBtnImg"
SelectionChanged="ComboBoxUnFoldBtnImg_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Arrow}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_UnfoldIcon_Pen}" />
</ComboBox>
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Theme_FloatingBarButtonsTitle}" />
<controls:LabeledSettingsCard x:Name="CardUseLegacyFloatingBarUI"
Header="{i18n:I18n Key=Theme_UseLegacyFloatingBarUI}"
Icon="{x:Static ui:SegoeFluentIcons.History}"
SwitchName="ToggleSwitchUseLegacyFloatingBarUI"
Toggled="ToggleSwitchUseLegacyFloatingBarUI_Toggled" />
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowShapeButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowShapeButton"
Toggled="ToggleSwitchShowShapeButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowUndoButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowUndoButton"
Toggled="ToggleSwitchShowUndoButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowRedoButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowRedoButton"
Toggled="ToggleSwitchShowRedoButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowClearButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowClearButton"
Toggled="ToggleSwitchShowClearButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowWhiteboardButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowWhiteboardButton"
Toggled="ToggleSwitchShowWhiteboardButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowHideButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowHideButton"
Toggled="ToggleSwitchShowHideButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowLassoButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowLassoSelectButton"
Toggled="ToggleSwitchShowLassoSelectButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowClearAndMouseButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowClearAndMouseButton"
Toggled="ToggleSwitchShowClearAndMouseButton_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_ShowQuickPalette}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowQuickColorPalette"
Toggled="ToggleSwitchShowQuickColorPalette_Toggled" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_QuickPaletteMode}">
<ComboBox x:Name="ComboBoxQuickColorPaletteDisplayMode"
SelectionChanged="ComboBoxQuickColorPaletteDisplayMode_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_SingleRow}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_QuickPalette_DoubleRow}" />
</ComboBox>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Theme_EraserButtonDisplay}">
<ComboBox x:Name="ComboBoxEraserDisplayOption"
SelectionChanged="ComboBoxEraserDisplayOption_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_Both}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_AreaOnly}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_LineOnly}" />
<ComboBoxItem Content="{i18n:I18n Key=Theme_EraserDisplay_None}" />
</ComboBox>
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Tray_GroupTitle}" />
<controls:LabeledSettingsCard x:Name="CardEnableTrayIcon"
Header="{i18n:I18n Key=Tray_EnableTrayIcon}"
Icon="{x:Static ui:SegoeFluentIcons.Pinned}"
SwitchName="ToggleSwitchEnableTrayIcon"
Toggled="ToggleSwitchEnableTrayIcon_Toggled" />
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>
@@ -1,40 +1,348 @@
using H.NotifyIcon;
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 AppearancePage : Page
public partial class AppearancePage : iNKORE.UI.WPF.Modern.Controls.Page
{
private bool _isLoaded = false;
public AppearancePage()
{
InitializeComponent();
Loaded += AppearancePage_Loaded;
}
private void SettingsCard_Click(object sender, RoutedEventArgs e)
private void AppearancePage_Loaded(object sender, RoutedEventArgs e)
{
SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow;
if (settingsWindow != null)
LoadSettings();
_isLoaded = true;
}
private void LoadSettings()
{
_isLoaded = false;
try
{
settingsWindow.NavigateToPage("ThemePage");
var settings = SettingsManager.Settings;
if (settings.Appearance != null)
{
ComboBoxTheme.SelectedIndex = settings.Appearance.Theme;
ComboBoxLanguage.SelectedIndex = int.TryParse(settings.Appearance.Language, out int langIdx) ? langIdx : 0;
CardEnableSplashScreen.IsOn = settings.Appearance.EnableSplashScreen;
ComboBoxSplashScreenStyle.SelectedIndex = settings.Appearance.SplashScreenStyle;
ComboBoxFloatingBarImg.SelectedIndex = settings.Appearance.FloatingBarImg;
ViewboxFloatingBarScaleTransformValueSlider.Value = settings.Appearance.ViewboxFloatingBarScaleTransformValue;
ViewboxFloatingBarOpacityValueSlider.Value = settings.Appearance.ViewboxFloatingBarOpacityValue;
ViewboxFloatingBarOpacityInPPTValueSlider.Value = settings.Appearance.ViewboxFloatingBarOpacityInPPTValue;
CardEnableDisPlayNibModeToggle.IsOn = settings.Appearance.IsEnableDisPlayNibModeToggler;
CardEnableViewboxBlackBoardScaleTransform.IsOn = settings.Appearance.EnableViewboxBlackBoardScaleTransform;
CardEnableTimeDisplayInWhiteboardMode.IsOn = settings.Appearance.EnableTimeDisplayInWhiteboardMode;
CardEnableChickenSoupInWhiteboardMode.IsOn = settings.Appearance.EnableChickenSoupInWhiteboardMode;
ComboBoxChickenSoupSource.SelectedIndex = settings.Appearance.ChickenSoupSource;
CardEnableQuickPanel.IsOn = settings.Appearance.IsShowQuickPanel;
ComboBoxUnFoldBtnImg.SelectedIndex = settings.Appearance.UnFoldButtonImageType;
CardUseLegacyFloatingBarUI.IsOn = settings.Appearance.UseLegacyFloatingBarUI;
ToggleSwitchShowShapeButton.IsOn = settings.Appearance.IsShowShapeButton;
ToggleSwitchShowUndoButton.IsOn = settings.Appearance.IsShowUndoButton;
ToggleSwitchShowRedoButton.IsOn = settings.Appearance.IsShowRedoButton;
ToggleSwitchShowClearButton.IsOn = settings.Appearance.IsShowClearButton;
ToggleSwitchShowWhiteboardButton.IsOn = settings.Appearance.IsShowWhiteboardButton;
ToggleSwitchShowHideButton.IsOn = settings.Appearance.IsShowHideButton;
ToggleSwitchShowLassoSelectButton.IsOn = settings.Appearance.IsShowLassoSelectButton;
ToggleSwitchShowClearAndMouseButton.IsOn = settings.Appearance.IsShowClearAndMouseButton;
ToggleSwitchShowQuickColorPalette.IsOn = settings.Appearance.IsShowQuickColorPalette;
ComboBoxQuickColorPaletteDisplayMode.SelectedIndex = settings.Appearance.QuickColorPaletteDisplayMode;
ComboBoxEraserDisplayOption.SelectedIndex = settings.Appearance.EraserDisplayOption;
CardEnableTrayIcon.IsOn = settings.Appearance.EnableTrayIcon;
}
}
catch (Exception ex)
{
Debug.WriteLine($"加载外观设置时出错: {ex.Message}");
}
_isLoaded = true;
}
private void ComboBoxTheme_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxTheme", (sender as ComboBox)?.SelectedItem);
}
private void ComboBoxLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.Language = ComboBoxLanguage.SelectedIndex.ToString();
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置语言时出错: {ex.Message}");
}
}
private void SettingsCard_Click_1(object sender, RoutedEventArgs e)
private void ToggleSwitchEnableSplashScreen_Toggled(object sender, RoutedEventArgs e)
{
SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow;
if (settingsWindow != null)
if (!_isLoaded) return;
try
{
settingsWindow.NavigateToPage("ColorsPage");
SettingsManager.Settings.Appearance.EnableSplashScreen = CardEnableSplashScreen.IsOn;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置启动画面时出错: {ex.Message}");
}
}
private void SettingsCard_Click_2(object sender, RoutedEventArgs e)
private void ComboBoxSplashScreenStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SettingsWindow settingsWindow = Window.GetWindow(this) as SettingsWindow;
if (settingsWindow != null)
if (!_isLoaded) return;
try
{
settingsWindow.NavigateToPage("FontsPage");
SettingsManager.Settings.Appearance.SplashScreenStyle = ComboBoxSplashScreenStyle.SelectedIndex;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置启动画面样式时出错: {ex.Message}");
}
}
private void ComboBoxFloatingBarImg_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxFloatingBarImg", (sender as ComboBox)?.SelectedItem);
}
private void ButtonAddCustomIcon_Click(object sender, RoutedEventArgs e)
{
MainWindowSettingsHelper.InvokeMainWindowMethod("ButtonAddCustomIcon_Click", sender, e);
}
private void ButtonManageCustomIcons_Click(object sender, RoutedEventArgs e)
{
MainWindowSettingsHelper.InvokeMainWindowMethod("ButtonManageCustomIcons_Click", sender, e);
}
private void ViewboxFloatingBarScaleTransformValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarScaleTransformValueSlider", e.NewValue);
}
private void ViewboxFloatingBarOpacityValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarOpacityValueSlider", e.NewValue);
}
private void ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarOpacityInPPTValueSlider", e.NewValue);
}
private void ToggleSwitchEnableDisPlayNibModeToggle_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableDisPlayNibModeToggle", CardEnableDisPlayNibModeToggle.IsOn);
}
private void ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableViewboxBlackBoardScaleTransform", CardEnableViewboxBlackBoardScaleTransform.IsOn);
}
private void ToggleSwitchEnableTimeDisplayInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTimeDisplayInWhiteboardMode", CardEnableTimeDisplayInWhiteboardMode.IsOn);
}
private void ToggleSwitchEnableChickenSoupInWhiteboardMode_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableChickenSoupInWhiteboardMode", CardEnableChickenSoupInWhiteboardMode.IsOn);
}
private void ComboBoxChickenSoupSource_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxChickenSoupSource", (sender as ComboBox)?.SelectedItem);
}
private void ToggleSwitchEnableQuickPanel_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowQuickPanel = CardEnableQuickPanel.IsOn;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置快捷面板时出错: {ex.Message}");
}
}
private void ComboBoxUnFoldBtnImg_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxUnFoldBtnImg", (sender as ComboBox)?.SelectedItem);
}
private void ToggleSwitchUseLegacyFloatingBarUI_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("CheckBoxUseLegacyFloatingBarUI", CardUseLegacyFloatingBarUI.IsOn);
}
private void ToggleSwitchShowShapeButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowShapeButton = ToggleSwitchShowShapeButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置形状按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowUndoButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowUndoButton = ToggleSwitchShowUndoButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置撤销按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowRedoButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowRedoButton = ToggleSwitchShowRedoButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置重做按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowClearButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowClearButton = ToggleSwitchShowClearButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置清空按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowWhiteboardButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowWhiteboardButton = ToggleSwitchShowWhiteboardButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置白板按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowHideButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowHideButton = ToggleSwitchShowHideButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置隐藏按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowLassoSelectButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowLassoSelectButton = ToggleSwitchShowLassoSelectButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置套索按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowClearAndMouseButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowClearAndMouseButton = ToggleSwitchShowClearAndMouseButton.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置清并鼠按钮时出错: {ex.Message}"); }
}
private void ToggleSwitchShowQuickColorPalette_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.IsShowQuickColorPalette = ToggleSwitchShowQuickColorPalette.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置快捷调色盘时出错: {ex.Message}"); }
}
private void ComboBoxQuickColorPaletteDisplayMode_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.QuickColorPaletteDisplayMode = ComboBoxQuickColorPaletteDisplayMode.SelectedIndex;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex) { Debug.WriteLine($"设置调色盘模式时出错: {ex.Message}"); }
}
private void ComboBoxEraserDisplayOption_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Appearance.EraserDisplayOption = ComboBoxEraserDisplayOption.SelectedIndex;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("UpdateFloatingBarButtonsVisibility");
}
catch (Exception ex) { Debug.WriteLine($"设置橡皮擦显示时出错: {ex.Message}"); }
}
private void ToggleSwitchEnableTrayIcon_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggledWithThemeCheck("ToggleSwitchEnableTrayIcon", CardEnableTrayIcon.IsOn);
}
}
}
@@ -0,0 +1,76 @@
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AutomationPage"
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:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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>
<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="CardAutoFoldInEasiNote" Header="希沃白板 5" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInEasiNote" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote3" Header="希沃白板 3" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInEasiNote3" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote3C" Header="希沃白板 3C" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInEasiNote3C" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote5C" Header="希沃白板 5C" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInEasiNote5C" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInSeewoPincoTeacher" Header="希沃品课" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInSeewoPincoTeacher" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiCamera" Header="希沃视频展台" Icon="{x:Static ui:SegoeFluentIcons.Camera}" SwitchName="ToggleSwitchAutoFoldInEasiCamera" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteTouchPro" Header="鸿合白板" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInHiteTouchPro" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteCamera" Header="鸿合视频展台" Icon="{x:Static ui:SegoeFluentIcons.Camera}" SwitchName="ToggleSwitchAutoFoldInHiteCamera" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteLightBoard" Header="鸿合灯板" Icon="{x:Static ui:SegoeFluentIcons.Light}" SwitchName="ToggleSwitchAutoFoldInHiteLightBoard" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInWxBoardMain" Header="微信白板" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInWxBoardMain" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInMSWhiteboard" Header="Microsoft Whiteboard" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInMSWhiteboard" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInAdmoxWhiteboard" Header="Admox 白板" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInAdmoxWhiteboard" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInAdmoxBooth" Header="Admox 展台" Icon="{x:Static ui:SegoeFluentIcons.Camera}" SwitchName="ToggleSwitchAutoFoldInAdmoxBooth" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInQPoint" Header="QPoint" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInQPoint" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInYiYunVisualPresenter" Header="易云展台" Icon="{x:Static ui:SegoeFluentIcons.Camera}" SwitchName="ToggleSwitchAutoFoldInYiYunVisualPresenter" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInMaxHubWhiteboard" Header="MaxHub 白板" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInMaxHubWhiteboard" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInOldZyBoard" Header="中银白板" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchAutoFoldInOldZyBoard" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldInPPTSlideShow" Header="PPT 放映" Icon="{x:Static ui:SegoeFluentIcons.Document}" SwitchName="ToggleSwitchAutoFoldInPPTSlideShow" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldAfterPPTSlideShow" Header="PPT 结束后自动收纳" Icon="{x:Static ui:SegoeFluentIcons.ChevronDown}" SwitchName="ToggleSwitchAutoFoldAfterPPTSlideShow" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardKeepFoldAfterSoftwareExit" Header="软件退出后保持收纳" Icon="{x:Static ui:SegoeFluentIcons.ChevronDown}" SwitchName="ToggleSwitchKeepFoldAfterSoftwareExit" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationModeWhenExitFoldMode" Header="退出收纳时进入批注模式" Icon="{x:Static ui:SegoeFluentIcons.Edit}" SwitchName="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode" Toggled="AutoFold_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoFoldWhenExitWhiteboard" Header="退出白板时自动收纳" Icon="{x:Static ui:SegoeFluentIcons.ChevronDown}" SwitchName="ToggleSwitchAutoFoldWhenExitWhiteboard" Toggled="AutoFold_Toggled" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="自动保存" />
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesAtClear" Header="清空时自动保存墨迹" Icon="{x:Static ui:SegoeFluentIcons.Save}" SwitchName="ToggleSwitchAutoSaveStrokesAtClear" Toggled="AutoSave_Toggled" />
<controls:LabeledSettingsCard x:Name="CardSaveScreenshotsInDateFolders" Header="截图按日期分文件夹" Icon="{x:Static ui:SegoeFluentIcons.Folder}" SwitchName="ToggleSwitchSaveScreenshotsInDateFolders" Toggled="AutoSave_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesAtScreenshot" Header="截图时自动保存墨迹" Icon="{x:Static ui:SegoeFluentIcons.Save}" SwitchName="ToggleSwitchAutoSaveStrokesAtScreenshot" Toggled="AutoSave_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableAutoSaveStrokes" Header="启用自动保存墨迹" Icon="{x:Static ui:SegoeFluentIcons.SaveLocal}" SwitchName="ToggleSwitchEnableAutoSaveStrokes" Toggled="AutoSave_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoDelSavedFiles" Header="自动删除旧保存文件" Icon="{x:Static ui:SegoeFluentIcons.Delete}" SwitchName="ToggleSwitchAutoDelSavedFiles" Toggled="AutoSave_Toggled" />
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>
@@ -0,0 +1,127 @@
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 AutomationPage : iNKORE.UI.WPF.Modern.Controls.Page
{
private bool _isLoaded = false;
public AutomationPage()
{
InitializeComponent();
Loaded += AutomationPage_Loaded;
}
private void AutomationPage_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
_isLoaded = true;
}
private void LoadSettings()
{
_isLoaded = false;
try
{
var settings = SettingsManager.Settings;
if (settings.Automation != null)
{
CardAutoFoldInEasiNote.IsOn = settings.Automation.IsAutoFoldInEasiNote;
CardAutoFoldInEasiNote3.IsOn = settings.Automation.IsAutoFoldInEasiNote3;
CardAutoFoldInEasiNote3C.IsOn = settings.Automation.IsAutoFoldInEasiNote3C;
CardAutoFoldInEasiNote5C.IsOn = settings.Automation.IsAutoFoldInEasiNote5C;
CardAutoFoldInSeewoPincoTeacher.IsOn = settings.Automation.IsAutoFoldInSeewoPincoTeacher;
CardAutoFoldInEasiCamera.IsOn = settings.Automation.IsAutoFoldInEasiCamera;
CardAutoFoldInHiteTouchPro.IsOn = settings.Automation.IsAutoFoldInHiteTouchPro;
CardAutoFoldInHiteCamera.IsOn = settings.Automation.IsAutoFoldInHiteCamera;
CardAutoFoldInHiteLightBoard.IsOn = settings.Automation.IsAutoFoldInHiteLightBoard;
CardAutoFoldInWxBoardMain.IsOn = settings.Automation.IsAutoFoldInWxBoardMain;
CardAutoFoldInMSWhiteboard.IsOn = settings.Automation.IsAutoFoldInMSWhiteboard;
CardAutoFoldInAdmoxWhiteboard.IsOn = settings.Automation.IsAutoFoldInAdmoxWhiteboard;
CardAutoFoldInAdmoxBooth.IsOn = settings.Automation.IsAutoFoldInAdmoxBooth;
CardAutoFoldInQPoint.IsOn = settings.Automation.IsAutoFoldInQPoint;
CardAutoFoldInYiYunVisualPresenter.IsOn = settings.Automation.IsAutoFoldInYiYunVisualPresenter;
CardAutoFoldInMaxHubWhiteboard.IsOn = settings.Automation.IsAutoFoldInMaxHubWhiteboard;
CardAutoFoldInOldZyBoard.IsOn = settings.Automation.IsAutoFoldInOldZyBoard;
CardAutoFoldInPPTSlideShow.IsOn = settings.Automation.IsAutoFoldInPPTSlideShow;
CardAutoFoldAfterPPTSlideShow.IsOn = settings.Automation.IsAutoFoldAfterPPTSlideShow;
CardKeepFoldAfterSoftwareExit.IsOn = settings.Automation.KeepFoldAfterSoftwareExit;
CardAutoEnterAnnotationModeWhenExitFoldMode.IsOn = settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode;
CardAutoFoldWhenExitWhiteboard.IsOn = settings.Automation.IsAutoFoldWhenExitWhiteboard;
CardAutoSaveStrokesAtClear.IsOn = settings.Automation.IsAutoSaveStrokesAtClear;
CardSaveScreenshotsInDateFolders.IsOn = settings.Automation.IsSaveScreenshotsInDateFolders;
CardAutoSaveStrokesAtScreenshot.IsOn = settings.Automation.IsAutoSaveStrokesAtScreenshot;
CardEnableAutoSaveStrokes.IsOn = settings.Automation.IsEnableAutoSaveStrokes;
CardAutoDelSavedFiles.IsOn = settings.Automation.AutoDelSavedFiles;
}
}
catch (Exception ex)
{
Debug.WriteLine($"加载自动化设置时出错: {ex.Message}");
}
_isLoaded = true;
}
private void AutoFold_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
var settings = SettingsManager.Settings.Automation;
settings.IsAutoFoldInEasiNote = CardAutoFoldInEasiNote.IsOn;
settings.IsAutoFoldInEasiNote3 = CardAutoFoldInEasiNote3.IsOn;
settings.IsAutoFoldInEasiNote3C = CardAutoFoldInEasiNote3C.IsOn;
settings.IsAutoFoldInEasiNote5C = CardAutoFoldInEasiNote5C.IsOn;
settings.IsAutoFoldInSeewoPincoTeacher = CardAutoFoldInSeewoPincoTeacher.IsOn;
settings.IsAutoFoldInEasiCamera = CardAutoFoldInEasiCamera.IsOn;
settings.IsAutoFoldInHiteTouchPro = CardAutoFoldInHiteTouchPro.IsOn;
settings.IsAutoFoldInHiteCamera = CardAutoFoldInHiteCamera.IsOn;
settings.IsAutoFoldInHiteLightBoard = CardAutoFoldInHiteLightBoard.IsOn;
settings.IsAutoFoldInWxBoardMain = CardAutoFoldInWxBoardMain.IsOn;
settings.IsAutoFoldInMSWhiteboard = CardAutoFoldInMSWhiteboard.IsOn;
settings.IsAutoFoldInAdmoxWhiteboard = CardAutoFoldInAdmoxWhiteboard.IsOn;
settings.IsAutoFoldInAdmoxBooth = CardAutoFoldInAdmoxBooth.IsOn;
settings.IsAutoFoldInQPoint = CardAutoFoldInQPoint.IsOn;
settings.IsAutoFoldInYiYunVisualPresenter = CardAutoFoldInYiYunVisualPresenter.IsOn;
settings.IsAutoFoldInMaxHubWhiteboard = CardAutoFoldInMaxHubWhiteboard.IsOn;
settings.IsAutoFoldInOldZyBoard = CardAutoFoldInOldZyBoard.IsOn;
settings.IsAutoFoldInPPTSlideShow = CardAutoFoldInPPTSlideShow.IsOn;
settings.IsAutoFoldAfterPPTSlideShow = CardAutoFoldAfterPPTSlideShow.IsOn;
settings.KeepFoldAfterSoftwareExit = CardKeepFoldAfterSoftwareExit.IsOn;
settings.IsAutoEnterAnnotationModeWhenExitFoldMode = CardAutoEnterAnnotationModeWhenExitFoldMode.IsOn;
settings.IsAutoFoldWhenExitWhiteboard = CardAutoFoldWhenExitWhiteboard.IsOn;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeMainWindowMethod("StartOrStoptimerCheckAutoFold");
}
catch (Exception ex)
{
Debug.WriteLine($"设置自动收纳时出错: {ex.Message}");
}
}
private void AutoSave_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
var settings = SettingsManager.Settings.Automation;
settings.IsAutoSaveStrokesAtClear = CardAutoSaveStrokesAtClear.IsOn;
settings.IsSaveScreenshotsInDateFolders = CardSaveScreenshotsInDateFolders.IsOn;
settings.IsAutoSaveStrokesAtScreenshot = CardAutoSaveStrokesAtScreenshot.IsOn;
settings.IsEnableAutoSaveStrokes = CardEnableAutoSaveStrokes.IsOn;
settings.AutoDelSavedFiles = CardAutoDelSavedFiles.IsOn;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置自动保存时出错: {ex.Message}");
}
}
}
}
@@ -0,0 +1,78 @@
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.GesturePage"
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:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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=Gesture_Title}" />
<controls:LabeledSettingsCard x:Name="CardAutoSwitchTwoFingerGesture"
Header="{i18n:I18n Key=Gesture_AutoToggleTwoFinger}"
Description="{i18n:I18n Key=Gesture_AutoToggleHint}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchAutoSwitchTwoFingerGesture"
Toggled="ToggleSwitchAutoSwitchTwoFingerGesture_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableTwoFingerRotationOnSelection"
Header="{i18n:I18n Key=Gesture_AllowRotateScale}"
Description="{i18n:I18n Key=Gesture_AllowRotateScaleHint}"
Icon="{x:Static ui:SegoeFluentIcons.Rotate}"
SwitchName="ToggleSwitchEnableTwoFingerRotationOnSelection"
Toggled="ToggleSwitchEnableTwoFingerRotationOnSelection_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnablePalmEraser"
Header="{i18n:I18n Key=Gesture_EnablePalmEraser}"
Description="{i18n:I18n Key=Gesture_PalmHint}"
Icon="{x:Static ui:SegoeFluentIcons.EraseTool}"
SwitchName="ToggleSwitchEnablePalmEraser"
Toggled="ToggleSwitchEnablePalmEraser_Toggled" />
<ui:SettingsCard Header="{i18n:I18n Key=Gesture_PalmSensitivity}"
Visibility="{Binding ElementName=CardEnablePalmEraser, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxPalmEraserSensitivity"
SelectionChanged="ComboBoxPalmEraserSensitivity_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Gesture_PalmSensitivityLow}" />
<ComboBoxItem Content="{i18n:I18n Key=Gesture_PalmSensitivityMedium}" />
<ComboBoxItem Content="{i18n:I18n Key=Gesture_PalmSensitivityHigh}" />
</ComboBox>
</ui:SettingsCard>
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>
@@ -0,0 +1,83 @@
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 GesturePage : iNKORE.UI.WPF.Modern.Controls.Page
{
private bool _isLoaded = false;
public GesturePage()
{
InitializeComponent();
Loaded += GesturePage_Loaded;
}
private void GesturePage_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
_isLoaded = true;
}
private void LoadSettings()
{
_isLoaded = false;
try
{
var settings = SettingsManager.Settings;
if (settings.Gesture != null)
{
CardAutoSwitchTwoFingerGesture.IsOn = settings.Gesture.AutoSwitchTwoFingerGesture;
CardEnableTwoFingerRotationOnSelection.IsOn = settings.Gesture.IsEnableTwoFingerRotationOnSelection;
}
if (settings.Canvas != null)
{
CardEnablePalmEraser.IsOn = settings.Canvas.EnablePalmEraser;
ComboBoxPalmEraserSensitivity.SelectedIndex = settings.Canvas.PalmEraserSensitivity;
}
}
catch (Exception ex)
{
Debug.WriteLine($"加载手势设置时出错: {ex.Message}");
}
_isLoaded = true;
}
private void ToggleSwitchAutoSwitchTwoFingerGesture_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSwitchTwoFingerGesture", CardAutoSwitchTwoFingerGesture.IsOn);
}
private void ToggleSwitchEnableTwoFingerRotationOnSelection_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTwoFingerRotationOnSelection", CardEnableTwoFingerRotationOnSelection.IsOn);
}
private void ToggleSwitchEnablePalmEraser_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePalmEraser", CardEnablePalmEraser.IsOn);
}
private void ComboBoxPalmEraserSensitivity_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
try
{
SettingsManager.Settings.Canvas.PalmEraserSensitivity = ComboBoxPalmEraserSensitivity.SelectedIndex;
SettingsManager.SaveSettingsToFile();
}
catch (Exception ex)
{
Debug.WriteLine($"设置掌擦灵敏度时出错: {ex.Message}");
}
}
}
}
@@ -0,0 +1,169 @@
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.PPTPage"
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:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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="PPT">
<ScrollViewer PanningMode="VerticalFirst">
<Grid Margin="59,0,59,0">
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
<Style.Setters>
<Setter Property="Margin" Value="1,30,0,6" />
</Style.Setters>
</Style>
</FrameworkElement.Resources>
<Grid>
<ikw:SimpleStackPanel MaxWidth="1000"
HorizontalAlignment="Stretch"
Spacing="{StaticResource SettingsCardSpacing}">
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="PPT 支持" />
<controls:LabeledSettingsCard x:Name="CardSupportPowerPoint"
Header="{i18n:I18n Key=PPT_SupportPowerPoint}"
Icon="{x:Static ui:SegoeFluentIcons.Document}"
SwitchName="ToggleSwitchSupportPowerPoint"
Toggled="ToggleSwitchSupportPowerPoint_Toggled" />
<controls:LabeledSettingsCard x:Name="CardPowerPointEnhancement"
Header="{i18n:I18n Key=PPT_Enhancement}"
Icon="{x:Static ui:SegoeFluentIcons.Lightbulb}"
SwitchName="ToggleSwitchPowerPointEnhancement"
Toggled="ToggleSwitchPowerPointEnhancement_Toggled" />
<controls:LabeledSettingsCard x:Name="CardSkipAnimationsWhenGoNext"
Header="{i18n:I18n Key=PPT_SkipAnimations}"
Icon="{x:Static ui:SegoeFluentIcons.FastForward}"
SwitchName="ToggleSwitchSkipAnimationsWhenGoNext"
Toggled="ToggleSwitchSkipAnimationsWhenGoNext_Toggled" />
<controls:LabeledSettingsCard x:Name="CardUseRotPptLink"
Header="{i18n:I18n Key=PPT_UseRotPptLink}"
Icon="{x:Static ui:SegoeFluentIcons.Link}"
SwitchName="ToggleSwitchUseRotPptLink"
Toggled="ToggleSwitchUseRotPptLink_Toggled" />
<controls:LabeledSettingsCard x:Name="CardSupportWPS"
Header="{i18n:I18n Key=PPT_SupportWPS}"
Icon="{x:Static ui:SegoeFluentIcons.Document}"
SwitchName="ToggleSwitchSupportWPS"
Toggled="ToggleSwitchSupportWPS_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableWppProcessKill"
Header="{i18n:I18n Key=PPT_EnableWppProcessKill}"
Icon="{x:Static ui:SegoeFluentIcons.Cancel}"
SwitchName="ToggleSwitchEnableWppProcessKill"
Toggled="ToggleSwitchEnableWppProcessKill_Toggled" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="PPT 翻页按钮" />
<controls:LabeledSettingsCard x:Name="CardShowPPTButton"
Header="{i18n:I18n Key=PPT_ShowPPTButton}"
Icon="{x:Static ui:SegoeFluentIcons.OpenPane}"
SwitchName="ToggleSwitchShowPPTButton"
Toggled="ToggleSwitchShowPPTButton_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnablePPTButtonPageClickable"
Header="{i18n:I18n Key=PPT_EnablePageClickable}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchEnablePPTButtonPageClickable"
Toggled="ToggleSwitchEnablePPTButtonPageClickable_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnablePPTButtonLongPressPageTurn"
Header="{i18n:I18n Key=PPT_EnableLongPressPageTurn}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchEnablePPTButtonLongPressPageTurn"
Toggled="ToggleSwitchEnablePPTButtonLongPressPageTurn_Toggled" />
<controls:LabeledSettingsCard x:Name="CardShowPPTSidebarByDefault"
Header="{i18n:I18n Key=PPT_ShowSidebarByDefault}"
Icon="{x:Static ui:SegoeFluentIcons.OpenPane}"
SwitchName="ToggleSwitchShowPPTSidebarByDefault"
Toggled="ToggleSwitchShowPPTSidebarByDefault_Toggled" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="PPT 演示设置" />
<controls:LabeledSettingsCard x:Name="CardShowCanvasAtNewSlideShow"
Header="{i18n:I18n Key=PPT_ShowCanvasAtNewSlideShow}"
Icon="{x:Static ui:SegoeFluentIcons.Edit}"
SwitchName="ToggleSwitchShowCanvasAtNewSlideShow"
Toggled="ToggleSwitchShowCanvasAtNewSlideShow_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableTwoFingerGestureInPresentationMode"
Header="{i18n:I18n Key=PPT_EnableTwoFingerGesture}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
SwitchName="ToggleSwitchEnableTwoFingerGestureInPresentationMode"
Toggled="ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnableFingerGestureSlideShowControl"
Header="{i18n:I18n Key=PPT_EnableFingerGestureControl}"
Icon="{x:Static ui:SegoeFluentIcons.Handwriting}"
SwitchName="ToggleSwitchEnableFingerGestureSlideShowControl"
Toggled="ToggleSwitchEnableFingerGestureSlideShowControl_Toggled" />
<controls:LabeledSettingsCard x:Name="CardEnablePPTTimeCapsule"
Header="{i18n:I18n Key=PPT_EnableTimeCapsule}"
Icon="{x:Static ui:SegoeFluentIcons.DateTime}"
SwitchName="ToggleSwitchEnablePPTTimeCapsule"
Toggled="ToggleSwitchEnablePPTTimeCapsule_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoSaveScreenShotInPowerPoint"
Header="{i18n:I18n Key=PPT_AutoSaveScreenshot}"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
SwitchName="ToggleSwitchAutoSaveScreenShotInPowerPoint"
Toggled="ToggleSwitchAutoSaveScreenShotInPowerPoint_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesInPowerPoint"
Header="{i18n:I18n Key=PPT_AutoSaveStrokes}"
Icon="{x:Static ui:SegoeFluentIcons.SaveLocal}"
SwitchName="ToggleSwitchAutoSaveStrokesInPowerPoint"
Toggled="ToggleSwitchAutoSaveStrokesInPowerPoint_Toggled" />
<controls:LabeledSettingsCard x:Name="CardNotifyPreviousPage"
Header="{i18n:I18n Key=PPT_NotifyPreviousPage}"
Icon="{x:Static ui:SegoeFluentIcons.Previous}"
SwitchName="ToggleSwitchNotifyPreviousPage"
Toggled="ToggleSwitchNotifyPreviousPage_Toggled" />
<controls:LabeledSettingsCard x:Name="CardAlwaysGoToFirstPageOnReenter"
Header="{i18n:I18n Key=PPT_AlwaysGoToFirstPage}"
Icon="{x:Static ui:SegoeFluentIcons.Rewind}"
SwitchName="ToggleSwitchAlwaysGoToFirstPageOnReenter"
Toggled="ToggleSwitchAlwaysGoToFirstPageOnReenter_Toggled" />
<controls:LabeledSettingsCard x:Name="CardNotifyHiddenPage"
Header="{i18n:I18n Key=PPT_NotifyHiddenPage}"
Icon="{x:Static ui:SegoeFluentIcons.Hide}"
SwitchName="ToggleSwitchNotifyHiddenPage"
Toggled="ToggleSwitchNotifyHiddenPage_Toggled" />
<controls:LabeledSettingsCard x:Name="CardNotifyAutoPlayPresentation"
Header="{i18n:I18n Key=PPT_NotifyAutoPlay}"
Icon="{x:Static ui:SegoeFluentIcons.Play}"
SwitchName="ToggleSwitchNotifyAutoPlayPresentation"
Toggled="ToggleSwitchNotifyAutoPlayPresentation_Toggled" />
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>
@@ -0,0 +1,183 @@
using Ink_Canvas.Windows.SettingsViews.Helpers;
using System;
using System.Diagnostics;
using System.Windows;
namespace Ink_Canvas.Windows.SettingsViews.Pages
{
public partial class PPTPage : iNKORE.UI.WPF.Modern.Controls.Page
{
private bool _isLoaded = false;
public PPTPage()
{
InitializeComponent();
Loaded += PPTPage_Loaded;
}
private void PPTPage_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
_isLoaded = true;
}
private void LoadSettings()
{
_isLoaded = false;
try
{
var settings = SettingsManager.Settings;
if (settings.PowerPointSettings != null)
{
CardSupportPowerPoint.IsOn = settings.PowerPointSettings.PowerPointSupport;
CardPowerPointEnhancement.IsOn = settings.PowerPointSettings.EnablePowerPointEnhancement;
CardSkipAnimationsWhenGoNext.IsOn = settings.PowerPointSettings.SkipAnimationsWhenGoNext;
CardUseRotPptLink.IsOn = settings.PowerPointSettings.UseRotPptLink;
CardSupportWPS.IsOn = settings.PowerPointSettings.IsSupportWPS;
CardEnableWppProcessKill.IsOn = settings.PowerPointSettings.EnableWppProcessKill;
CardShowPPTButton.IsOn = settings.PowerPointSettings.ShowPPTButton;
CardEnablePPTButtonPageClickable.IsOn = settings.PowerPointSettings.EnablePPTButtonPageClickable;
CardEnablePPTButtonLongPressPageTurn.IsOn = settings.PowerPointSettings.EnablePPTButtonLongPressPageTurn;
CardShowPPTSidebarByDefault.IsOn = settings.PowerPointSettings.ShowPPTSidebarByDefault;
CardShowCanvasAtNewSlideShow.IsOn = settings.PowerPointSettings.IsShowCanvasAtNewSlideShow;
CardEnableTwoFingerGestureInPresentationMode.IsOn = settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode;
CardEnableFingerGestureSlideShowControl.IsOn = settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl;
CardEnablePPTTimeCapsule.IsOn = settings.PowerPointSettings.EnablePPTTimeCapsule;
CardAutoSaveScreenShotInPowerPoint.IsOn = settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint;
CardAutoSaveStrokesInPowerPoint.IsOn = settings.PowerPointSettings.IsAutoSaveStrokesInPowerPoint;
CardNotifyPreviousPage.IsOn = settings.PowerPointSettings.IsNotifyPreviousPage;
CardAlwaysGoToFirstPageOnReenter.IsOn = settings.PowerPointSettings.IsAlwaysGoToFirstPageOnReenter;
CardNotifyHiddenPage.IsOn = settings.PowerPointSettings.IsNotifyHiddenPage;
CardNotifyAutoPlayPresentation.IsOn = settings.PowerPointSettings.IsNotifyAutoPlayPresentation;
}
}
catch (Exception ex)
{
Debug.WriteLine($"加载PPT设置时出错: {ex.Message}");
}
_isLoaded = true;
}
private void ToggleSwitchSupportPowerPoint_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSupportPowerPoint", CardSupportPowerPoint.IsOn);
}
private void ToggleSwitchPowerPointEnhancement_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchPowerPointEnhancement", CardPowerPointEnhancement.IsOn);
}
private void ToggleSwitchSkipAnimationsWhenGoNext_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSkipAnimationsWhenGoNext", CardSkipAnimationsWhenGoNext.IsOn);
}
private void ToggleSwitchUseRotPptLink_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchUseRotPptLink", CardUseRotPptLink.IsOn);
}
private void ToggleSwitchSupportWPS_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSupportWPS", CardSupportWPS.IsOn);
}
private void ToggleSwitchEnableWppProcessKill_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableWppProcessKill", CardEnableWppProcessKill.IsOn);
}
private void ToggleSwitchShowPPTButton_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowPPTButton", CardShowPPTButton.IsOn);
}
private void ToggleSwitchEnablePPTButtonPageClickable_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTButtonPageClickable", CardEnablePPTButtonPageClickable.IsOn);
}
private void ToggleSwitchEnablePPTButtonLongPressPageTurn_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTButtonLongPressPageTurn", CardEnablePPTButtonLongPressPageTurn.IsOn);
}
private void ToggleSwitchShowPPTSidebarByDefault_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowPPTSidebarByDefault", CardShowPPTSidebarByDefault.IsOn);
}
private void ToggleSwitchShowCanvasAtNewSlideShow_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowCanvasAtNewSlideShow", CardShowCanvasAtNewSlideShow.IsOn);
}
private void ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTwoFingerGestureInPresentationMode", CardEnableTwoFingerGestureInPresentationMode.IsOn);
}
private void ToggleSwitchEnableFingerGestureSlideShowControl_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableFingerGestureSlideShowControl", CardEnableFingerGestureSlideShowControl.IsOn);
}
private void ToggleSwitchEnablePPTTimeCapsule_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTTimeCapsule", CardEnablePPTTimeCapsule.IsOn);
}
private void ToggleSwitchAutoSaveScreenShotInPowerPoint_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveScreenShotInPowerPoint", CardAutoSaveScreenShotInPowerPoint.IsOn);
}
private void ToggleSwitchAutoSaveStrokesInPowerPoint_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveStrokesInPowerPoint", CardAutoSaveStrokesInPowerPoint.IsOn);
}
private void ToggleSwitchNotifyPreviousPage_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyPreviousPage", CardNotifyPreviousPage.IsOn);
}
private void ToggleSwitchAlwaysGoToFirstPageOnReenter_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysGoToFirstPageOnReenter", CardAlwaysGoToFirstPageOnReenter.IsOn);
}
private void ToggleSwitchNotifyHiddenPage_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyHiddenPage", CardNotifyHiddenPage.IsOn);
}
private void ToggleSwitchNotifyAutoPlayPresentation_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyAutoPlayPresentation", CardNotifyAutoPlayPresentation.IsOn);
}
}
}
@@ -116,6 +116,41 @@
SwitchName="ToggleSwitchFoldAtStartup"
Toggled="ToggleSwitchFoldAtStartup_Toggled" />
<!-- 笔尖模式 -->
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Startup_NibMode}" />
<controls:LabeledSettingsCard x:Name="CardEnableNibMode"
Header="{i18n:I18n Key=Startup_NibMode}"
Description="{i18n:I18n Key=Startup_NibModeHint}"
Icon="{x:Static ui:SegoeFluentIcons.PenTips}"
SwitchName="ToggleSwitchEnableNibMode"
Toggled="ToggleSwitchEnableNibMode_Toggled" />
<!-- 崩溃处理 -->
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Crash_Title}" />
<ui:SettingsCard Header="{i18n:I18n Key=Crash_Title}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Warning}" />
</ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="RadioCrashSilentRestart"
GroupName="CrashAction"
Content="{i18n:I18n Key=Crash_SilentRestart}"
Checked="RadioCrashAction_Checked" />
<RadioButton x:Name="RadioCrashNoAction"
GroupName="CrashAction"
Content="{i18n:I18n Key=Crash_NoAction}"
Checked="RadioCrashAction_Checked" />
</StackPanel>
</ui:SettingsCard>
<TextBlock Text="{i18n:I18n Key=Crash_Hint}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap" Margin="0,0,0,4" />
<!-- 运行模式 -->
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Settings_ModeDesc_1}" />
@@ -69,6 +69,16 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
if (settings.Startup != null)
{
CardFoldAtStartup.IsOn = settings.Startup.IsFoldAtStartup;
CardEnableNibMode.IsOn = settings.Startup.IsEnableNibMode;
if (settings.Startup.CrashAction == 0)
{
RadioCrashSilentRestart.IsChecked = true;
}
else
{
RadioCrashNoAction.IsChecked = true;
}
}
if (settings.ModeSettings != null)
@@ -309,6 +319,49 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
}
}
private void ToggleSwitchEnableNibMode_Toggled(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
bool newState = CardEnableNibMode.IsOn;
SettingsManager.Settings.Startup.IsEnableNibMode = newState;
SettingsManager.SaveSettingsToFile();
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableNibMode", newState);
}
catch (Exception ex)
{
Debug.WriteLine($"设置笔尖模式时出错: {ex.Message}");
}
}
private void RadioCrashAction_Checked(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
try
{
if (RadioCrashSilentRestart != null && RadioCrashSilentRestart.IsChecked == true)
{
App.CrashAction = App.CrashActionType.SilentRestart;
SettingsManager.Settings.Startup.CrashAction = 0;
}
else if (RadioCrashNoAction != null && RadioCrashNoAction.IsChecked == true)
{
App.CrashAction = App.CrashActionType.NoAction;
SettingsManager.Settings.Startup.CrashAction = 1;
}
SettingsManager.SaveSettingsToFile();
App.SyncCrashActionFromSettings();
}
catch (Exception ex)
{
Debug.WriteLine($"设置崩溃后操作时出错: {ex.Message}");
}
}
#endregion
#region
@@ -144,6 +144,51 @@
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
x:Name="AppearancePageItem"
Content="外观"
Tag="AppearancePage"
ToolTipService.ToolTip="外观设置">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
x:Name="GesturePageItem"
Content="手势"
Tag="GesturePage"
ToolTipService.ToolTip="手势设置">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Touch}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
x:Name="PPTPageItem"
Content="PPT"
Tag="PPTPage"
ToolTipService.ToolTip="PPT设置">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Document}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
x:Name="AdvancedPageItem"
Content="高级"
Tag="AdvancedPage"
ToolTipService.ToolTip="高级设置">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DeveloperTools}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
x:Name="AutomationPageItem"
Content="自动化"
Tag="AutomationPage"
ToolTipService.ToolTip="自动化设置">
<ui:NavigationViewItem.Icon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Robot}"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationViewItem.MenuItems>
</ui:NavigationViewItem>
@@ -39,6 +39,11 @@ namespace Ink_Canvas.Windows.SettingsViews
{ "HomePage", typeof(HomePage) },
{ "BasicPage", typeof(BasicPage) },
{ "StartupPage", typeof(StartupPage) },
{ "AppearancePage", typeof(AppearancePage) },
{ "GesturePage", typeof(GesturePage) },
{ "PPTPage", typeof(PPTPage) },
{ "AdvancedPage", typeof(AdvancedPage) },
{ "AutomationPage", typeof(AutomationPage) },
{ "UpdatePage", typeof(UpdatePage) },
{ "CanvasPage", typeof(CanvasPage) },
{ "DebugPage", typeof(IconographyPage) },