add:实时笔锋及墨迹预测

This commit is contained in:
2026-03-28 17:06:16 +08:00
parent de3f5d16a2
commit 56a65af9a7
6 changed files with 31 additions and 81 deletions
+2 -4
View File
@@ -26,10 +26,8 @@ namespace Ink_Canvas
{
bool on = Settings?.Canvas != null && Settings.Canvas.EnableInkStrokePrediction;
var v = on ? Visibility.Visible : Visibility.Collapsed;
if (ComboBoxInkStrokePredictionLead != null)
ComboBoxInkStrokePredictionLead.Visibility = v;
if (BoardComboBoxInkStrokePredictionLead != null)
BoardComboBoxInkStrokePredictionLead.Visibility = v;
if (ComboBoxInkStrokePredictionLeadSettings != null)
ComboBoxInkStrokePredictionLeadSettings.Visibility = v;
}
catch
{
+4 -19
View File
@@ -2700,19 +2700,11 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ToggleSwitchInkStrokePredictionPanel_Toggled(object sender, RoutedEventArgs e)
private void ToggleSwitchInkStrokePredictionSettings_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
bool on = ReferenceEquals(sender, BoardToggleSwitchInkStrokePredictionPanel)
? BoardToggleSwitchInkStrokePredictionPanel.IsOn
: ToggleSwitchInkStrokePredictionPanel.IsOn;
if (ReferenceEquals(sender, ToggleSwitchInkStrokePredictionPanel) && BoardToggleSwitchInkStrokePredictionPanel != null)
BoardToggleSwitchInkStrokePredictionPanel.IsOn = on;
else if (ReferenceEquals(sender, BoardToggleSwitchInkStrokePredictionPanel) && ToggleSwitchInkStrokePredictionPanel != null)
ToggleSwitchInkStrokePredictionPanel.IsOn = on;
bool on = ToggleSwitchInkStrokePredictionSettings != null && ToggleSwitchInkStrokePredictionSettings.IsOn;
Settings.Canvas.EnableInkStrokePrediction = on;
SyncInkStrokePredictionLeadComboVisibility();
if (!on)
@@ -2720,20 +2712,13 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ComboBoxInkStrokePredictionLead_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void ComboBoxInkStrokePredictionLeadSettings_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!isLoaded) return;
var cb = sender as ComboBox;
if (cb?.SelectedIndex < 0) return;
int idx = cb.SelectedIndex;
Settings.Canvas.InkStrokePredictionLeadMode = idx;
if (ReferenceEquals(cb, ComboBoxInkStrokePredictionLead) && BoardComboBoxInkStrokePredictionLead != null)
BoardComboBoxInkStrokePredictionLead.SelectedIndex = idx;
else if (ReferenceEquals(cb, BoardComboBoxInkStrokePredictionLead) && ComboBoxInkStrokePredictionLead != null)
ComboBoxInkStrokePredictionLead.SelectedIndex = idx;
Settings.Canvas.InkStrokePredictionLeadMode = cb.SelectedIndex;
SaveSettingsToFile();
}
@@ -955,14 +955,10 @@ namespace Ink_Canvas
if (leadMode < 0 || leadMode > 2) leadMode = 0;
Settings.Canvas.InkStrokePredictionLeadMode = leadMode;
if (ToggleSwitchInkStrokePredictionPanel != null)
ToggleSwitchInkStrokePredictionPanel.IsOn = Settings.Canvas.EnableInkStrokePrediction;
if (BoardToggleSwitchInkStrokePredictionPanel != null)
BoardToggleSwitchInkStrokePredictionPanel.IsOn = Settings.Canvas.EnableInkStrokePrediction;
if (ComboBoxInkStrokePredictionLead != null)
ComboBoxInkStrokePredictionLead.SelectedIndex = leadMode;
if (BoardComboBoxInkStrokePredictionLead != null)
BoardComboBoxInkStrokePredictionLead.SelectedIndex = leadMode;
if (ToggleSwitchInkStrokePredictionSettings != null)
ToggleSwitchInkStrokePredictionSettings.IsOn = Settings.Canvas.EnableInkStrokePrediction;
if (ComboBoxInkStrokePredictionLeadSettings != null)
ComboBoxInkStrokePredictionLeadSettings.SelectedIndex = leadMode;
SyncInkStrokePredictionLeadComboVisibility();
}
else