From 87f64ccc811a48f9013d250f2d1de12fa3f4add7 Mon Sep 17 00:00:00 2001
From: CJK_mkp <113243675+CJKmkp@users.noreply.github.com>
Date: Tue, 17 Jun 2025 18:21:14 +0800
Subject: [PATCH] =?UTF-8?q?improve:=E5=AF=B9=E9=9A=8F=E6=9C=BA=E6=8A=BD?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0=E7=A6=81=E7=94=A8=E5=BC=80?=
=?UTF-8?q?=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.vscode/settings.json | 3 +
Ink Canvas/MainWindow.xaml | 13 +-
.../MainWindow_cs/MW_FloatingBarIcons.cs | 10 +-
.../MainWindow_cs/MW_SelectionGestures.cs | 7 +
Ink Canvas/MainWindow_cs/MW_Settings.cs | 15 +
Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs | 9 +-
Ink Canvas/Resources/Settings.cs | 2 +
Ink Canvas/dist/InkCanvasForClass.exe | Bin 6236672 -> 6239744 bytes
.../net472/InkCanvasForClass.g.resources | Bin 5162031 -> 5162515 bytes
Ink Canvas/obj/Debug/net472/MainWindow.g.cs | 2699 +++++++++--------
Ink Canvas/obj/Debug/net472/MainWindow.g.i.cs | 2699 +++++++++--------
11 files changed, 2787 insertions(+), 2670 deletions(-)
create mode 100644 .vscode/settings.json
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..bb14cf9c
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "Codegeex.RepoIndex": true
+}
\ No newline at end of file
diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml
index aceef7c5..faf2da25 100644
--- a/Ink Canvas/MainWindow.xaml
+++ b/Ink Canvas/MainWindow.xaml
@@ -1965,6 +1965,15 @@
FontWeight="Bold"
Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled" />
+
+
+
+
@@ -4386,7 +4395,7 @@
-
@@ -4406,7 +4415,7 @@
-
diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
index e60f8f40..9bae70b4 100644
--- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
+++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs
@@ -740,9 +740,11 @@ namespace Ink_Canvas {
}
private void SymbolIconRand_MouseUp(object sender, MouseButtonEventArgs e) {
+ // 如果控件被隐藏,不处理事件
+ if (RandomDrawPanel.Visibility != Visibility.Visible) return;
+
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
- //if (lastBorderMouseDownObject != sender) return;
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
@@ -808,14 +810,16 @@ namespace Ink_Canvas {
}
private void SymbolIconRandOne_MouseUp(object sender, MouseButtonEventArgs e) {
+ // 如果控件被隐藏,不处理事件
+ if (SingleDrawPanel.Visibility != Visibility.Visible) return;
+
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
- //if (lastBorderMouseDownObject != sender) return;
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
- new RandWindow(Settings,true).ShowDialog();
+ new RandWindow(Settings, true).ShowDialog();
}
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
diff --git a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs
index ca679a1d..7f973e76 100644
--- a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs
+++ b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs
@@ -17,6 +17,13 @@ namespace Ink_Canvas {
private object lastBorderMouseDownObject;
private void Border_MouseDown(object sender, MouseButtonEventArgs e) {
+ // 如果发送者是 RandomDrawPanel 或 SingleDrawPanel,且它们被隐藏,则不处理事件
+ if (sender is SimpleStackPanel panel) {
+ if ((panel == RandomDrawPanel || panel == SingleDrawPanel) &&
+ panel.Visibility != Visibility.Visible) {
+ return;
+ }
+ }
lastBorderMouseDownObject = sender;
}
diff --git a/Ink Canvas/MainWindow_cs/MW_Settings.cs b/Ink Canvas/MainWindow_cs/MW_Settings.cs
index 2cafe7c8..6d6f1951 100644
--- a/Ink Canvas/MainWindow_cs/MW_Settings.cs
+++ b/Ink Canvas/MainWindow_cs/MW_Settings.cs
@@ -1690,6 +1690,21 @@ namespace Ink_Canvas {
SaveSettingsToFile();
}
+ private void ToggleSwitchShowRandomAndSingleDraw_Toggled(object sender, RoutedEventArgs e) {
+ if (!isLoaded) return;
+
+ // 获取开关状态并保存到设置中
+ bool isToggled = ToggleSwitchShowRandomAndSingleDraw.IsOn;
+ Settings.RandSettings.ShowRandomAndSingleDraw = isToggled;
+
+ // 更新UI显示
+ RandomDrawPanel.Visibility = isToggled ? Visibility.Visible : Visibility.Collapsed;
+ SingleDrawPanel.Visibility = isToggled ? Visibility.Visible : Visibility.Collapsed;
+
+ // 保存设置到文件
+ SaveSettingsToFile();
+ }
+
#endregion
public static void SaveSettingsToFile() {
diff --git a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
index bb70f8a1..407a1ea8 100644
--- a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
+++ b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
@@ -569,7 +569,14 @@ namespace Ink_Canvas {
}
// RandSettings
- if (Settings.RandSettings != null) { } else {
+ if (Settings.RandSettings != null) {
+ ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
+ RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
+ RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
+ ToggleSwitchShowRandomAndSingleDraw.IsOn = Settings.RandSettings.ShowRandomAndSingleDraw;
+ RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
+ SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
+ } else {
Settings.RandSettings = new RandSettings();
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs
index 0e49b8ba..948aa86d 100644
--- a/Ink Canvas/Resources/Settings.cs
+++ b/Ink Canvas/Resources/Settings.cs
@@ -406,5 +406,7 @@ namespace Ink_Canvas
public double RandWindowOnceCloseLatency { get; set; } = 2.5;
[JsonProperty("randWindowOnceMaxStudents")]
public int RandWindowOnceMaxStudents { get; set; } = 10;
+ [JsonProperty("showRandomAndSingleDraw")]
+ public bool ShowRandomAndSingleDraw { get; set; } = true;
}
}
\ No newline at end of file
diff --git a/Ink Canvas/dist/InkCanvasForClass.exe b/Ink Canvas/dist/InkCanvasForClass.exe
index ee0e0a9e5d20e915f5675bf258dac6cc5f3c8cdd..38e0fa6bb47e9f90b02a55158b2fbc6c56fe4df2 100644
GIT binary patch
delta 556253
zcmdpf2Vfk<)&Jh=bay&QwofPBso9c?