diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index e4109535..95f7ffc9 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -598,7 +598,7 @@ 开发者: XY Wang (WXRIW) - 贡献者: Kengwang, Raspberry Kan, jiajiaxd, CN-Ironegg, Clover Yan, ZongziTEK, ChangSakura + 贡献者: Kengwang, Raspberry Kan, jiajiaxd, CN-Ironegg, Clover Yan, STBBRD, ChangSakura 开源地址: diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 9670fa0d..dc13ed32 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -119,7 +119,7 @@ private void TimerKillProcess_Elapsed(object sender, ElapsedEventArgs e) if (processes.Length > 0) { arg += " /IM SeewoIwbAssistant.exe" + - " /IM Sia.Guard"; + " /IM Sia.Guard.exe"; } } if (Settings.Automation.IsAutoKillEasiNote) @@ -249,7 +249,7 @@ private void Main_Grid_PreviewKeyDown(object sender, KeyEventArgs e) { if (StackPanelPPTControls.Visibility != Visibility.Visible || currentMode != 0) return; - if (e.Key == Key.Down || e.Key == Key.PageDown || e.Key == Key.Right || e.Key == Key.N) + if (e.Key == Key.Down || e.Key == Key.PageDown || e.Key == Key.Right || e.Key == Key.N || e.Key == Key.Space) { BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null); } @@ -700,6 +700,14 @@ private void LoadSettings(bool isStartup = true) { ToggleSwitchEnableTwoFingerZoom.IsOn = false; } + if (Settings.Gesture.IsEnableTwoFingerTranslate) + { + ToggleSwitchEnableTwoFingerTranslate.IsOn = true; + } + else + { + ToggleSwitchEnableTwoFingerTranslate.IsOn = false; + } if (Settings.Gesture.IsEnableTwoFingerRotation) { ToggleSwitchEnableTwoFingerRotation.IsOn = true; @@ -759,6 +767,8 @@ private void LoadSettings(bool isStartup = true) ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle; ComboBoxEraserSize.SelectedIndex = Settings.Canvas.EraserSize; + + ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption; } else { @@ -1043,9 +1053,9 @@ private void BtnErase_Click(object sender, RoutedEventArgs e) forcePointEraser = false; break; } + inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5); inkCanvas.EditingMode = forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke; - inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5); drawingShapeMode = 0; GeometryDrawingEraser.Brush = forcePointEraser ? new SolidColorBrush(Color.FromRgb(0x23, 0xA9, 0xF2)) @@ -1060,6 +1070,15 @@ private void BtnClear_Click(object sender, RoutedEventArgs e) forceEraser = false; BorderClearInDelete.Visibility = Visibility.Collapsed; + if (currentMode == 0) { + BorderPenColorRed_MouseUp(BorderPenColorRed, null); + } else { + if (Settings.Canvas.UsingWhiteboard) { + BorderPenColorBlack_MouseUp(BorderPenColorBlack, null); + } else { + BorderPenColorWhite_MouseUp(BorderPenColorWhite, null); + } + } if (inkCanvas.Strokes.Count != 0) { int whiteboardIndex = CurrentWhiteboardIndex; @@ -1147,6 +1166,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e) } StackPanelPPTButtons.Visibility = Visibility.Visible; } + Topmost = true; BtnHideInkCanvas_Click(BtnHideInkCanvas, e); } else @@ -1186,6 +1206,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e) } StackPanelPPTButtons.Visibility = Visibility.Visible; + Topmost = true; break; case 1: //黑板或白板模式 currentMode = 1; @@ -1210,6 +1231,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e) } StackPanelPPTButtons.Visibility = Visibility.Collapsed; + Topmost = false; break; } } @@ -2288,8 +2310,11 @@ private void PptApplication_SlideShowBegin(SlideShowWindow Wn) LogHelper.WriteLogToFile("PowerPoint Application Slide Show Begin", LogHelper.LogType.Event); Application.Current.Dispatcher.Invoke(() => { - // 退出画板模式 - BtnSwitch_Click(null, null); + if (currentMode == 1) { + // 退出画板模式 + BtnSwitch_Click(null, null); + } + //调整颜色 double screenRatio = SystemParameters.PrimaryScreenWidth / SystemParameters.PrimaryScreenHeight; if (Math.Abs(screenRatio - 16.0 / 9) <= -0.01) @@ -4122,7 +4147,10 @@ private void BtnDrawLine_Click(object sender, EventArgs e) lastMouseDownSender = null; if (isLongPressSelected) { - BorderDrawShape.Visibility = Visibility.Collapsed; + if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) + { + BorderDrawShape.Visibility = Visibility.Collapsed; + } var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0))); ImageDrawLine.BeginAnimation(OpacityProperty, dA); } @@ -4141,7 +4169,10 @@ private void BtnDrawDashedLine_Click(object sender, EventArgs e) lastMouseDownSender = null; if (isLongPressSelected) { - BorderDrawShape.Visibility = Visibility.Collapsed; + if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) + { + BorderDrawShape.Visibility = Visibility.Collapsed; + } var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0))); ImageDrawDashedLine.BeginAnimation(OpacityProperty, dA); } @@ -4160,7 +4191,10 @@ private void BtnDrawDotLine_Click(object sender, EventArgs e) lastMouseDownSender = null; if (isLongPressSelected) { - BorderDrawShape.Visibility = Visibility.Collapsed; + if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) + { + BorderDrawShape.Visibility = Visibility.Collapsed; + } var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0))); ImageDrawDotLine.BeginAnimation(OpacityProperty, dA); } @@ -4179,7 +4213,10 @@ private void BtnDrawArrow_Click(object sender, EventArgs e) lastMouseDownSender = null; if (isLongPressSelected) { - BorderDrawShape.Visibility = Visibility.Collapsed; + if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) + { + BorderDrawShape.Visibility = Visibility.Collapsed; + } var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0))); ImageDrawArrow.BeginAnimation(OpacityProperty, dA); } @@ -4198,7 +4235,10 @@ private void BtnDrawParallelLine_Click(object sender, EventArgs e) lastMouseDownSender = null; if (isLongPressSelected) { - BorderDrawShape.Visibility = Visibility.Collapsed; + if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) + { + BorderDrawShape.Visibility = Visibility.Collapsed; + } var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0))); ImageDrawParallelLine.BeginAnimation(OpacityProperty, dA); } @@ -7070,8 +7110,6 @@ private void ImageBlackboard_MouseUp(object sender, MouseButtonEventArgs e) if (currentMode == 0) { //进入黑板 - Topmost = false; - if (BtnPPTSlideShowEnd.Visibility == Visibility.Collapsed) { pointDesktop = new Point(ViewboxFloatingBar.Margin.Left, ViewboxFloatingBar.Margin.Top); @@ -7105,8 +7143,6 @@ private void ImageBlackboard_MouseUp(object sender, MouseButtonEventArgs e) else { //关闭黑板 - Topmost = true; - if (isInMultiTouchMode) BorderMultiTouchMode_MouseUp(null, null); if (BtnPPTSlideShowEnd.Visibility == Visibility.Collapsed)