From 689caf0a1a9560e23c4d60ea8f6cc15cb4ee421c Mon Sep 17 00:00:00 2001 From: kriastans Date: Fri, 14 Jun 2024 22:15:33 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20PPT=E6=8C=89=E9=92=AE=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=8F=AF=E7=94=A8=EF=BC=88=E6=B2=A1=E7=A9=BA=E4=BF=AE?= =?UTF-8?q?Bug=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml | 415 +++++++++++------- Ink Canvas/MainWindow.xaml.cs | 2 - Ink Canvas/MainWindow_cs/MW_AutoFold.cs | 18 +- .../MainWindow_cs/MW_FloatingBarIcons.cs | 16 +- Ink Canvas/MainWindow_cs/MW_PPT.cs | 338 +++++++++++++- .../MainWindow_cs/MW_SelectionGestures.cs | 1 + Ink Canvas/MainWindow_cs/MW_Settings.cs | 88 ++-- Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs | 9 +- Ink Canvas/Resources/Settings.cs | 11 - 9 files changed, 653 insertions(+), 245 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index 537e466..cc1c5d3 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -891,14 +891,14 @@ 显示页码 半透明 黑色背景 @@ -917,33 +917,6 @@ Text="# 开启该选项后,点击页码按钮可以唤起PowerPoint自带的网格缩略图视图。WPS不支持该功能,开启也没用。" TextWrapping="Wrap" Foreground="#a1a1aa" /> - - - - - - - - - - - - - + - - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - + - - - - - - - - + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - + - - - - - - - - + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 99fec9b..b075a8a 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -107,8 +107,6 @@ namespace Ink_Canvas { private void loadPenCanvas() { try { - var alpha = Settings.Canvas.InkAlpha; - Trace.WriteLine(alpha); //drawingAttributes = new DrawingAttributes(); drawingAttributes = inkCanvas.DefaultDrawingAttributes; drawingAttributes.Color = Ink_DefaultColor; diff --git a/Ink Canvas/MainWindow_cs/MW_AutoFold.cs b/Ink Canvas/MainWindow_cs/MW_AutoFold.cs index 6ff22ad..ee0c69d 100644 --- a/Ink Canvas/MainWindow_cs/MW_AutoFold.cs +++ b/Ink Canvas/MainWindow_cs/MW_AutoFold.cs @@ -87,7 +87,8 @@ namespace Ink_Canvas { await Task.Delay(10); await Dispatcher.InvokeAsync(() => { - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; ViewboxFloatingBarMarginAnimation(-60); @@ -218,15 +219,12 @@ namespace Ink_Canvas { await Dispatcher.InvokeAsync(() => { if (StackPanelPPTControls.Visibility == Visibility.Visible) { - if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel && - isDisplayingOrHidingBlackboard == false) - AnimationsHelper.ShowWithSlideFromBottomAndFade(BottomViewboxPPTSidesControl); - if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel && - isDisplayingOrHidingBlackboard == false) - { - AnimationsHelper.ShowWithScaleFromLeft(LeftSidePanelForPPTNavigation); - AnimationsHelper.ShowWithScaleFromRight(RightSidePanelForPPTNavigation); - } + var dops = Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString(); + var dopsc = dops.ToCharArray(); + if (dopsc[0] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftBottomPanelForPPTNavigation); + if (dopsc[1] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightBottomPanelForPPTNavigation); + if (dopsc[2] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation); + if (dopsc[3] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation); } if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index e9a9f2a..9640bae 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -481,7 +481,8 @@ namespace Ink_Canvas { if (currentMode == 0) { - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; //进入黑板 @@ -566,13 +567,12 @@ namespace Ink_Canvas { if (StackPanelPPTControls.Visibility == Visibility.Visible) { - if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel) - AnimationsHelper.ShowWithSlideFromBottomAndFade(BottomViewboxPPTSidesControl); - if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel) - { - AnimationsHelper.ShowWithScaleFromLeft(LeftSidePanelForPPTNavigation); - AnimationsHelper.ShowWithScaleFromRight(RightSidePanelForPPTNavigation); - } + var dops = Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString(); + var dopsc = dops.ToCharArray(); + if (dopsc[0] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftBottomPanelForPPTNavigation); + if (dopsc[1] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightBottomPanelForPPTNavigation); + if (dopsc[2] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation); + if (dopsc[3] == '2' && isDisplayingOrHidingBlackboard == false) AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation); } if (Settings.Automation.IsAutoSaveStrokesAtClear && diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 945851c..eaba74a 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using System.Timers; using System.Windows; +using System.Windows.Controls; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; @@ -60,7 +61,8 @@ namespace Ink_Canvas { catch { //BtnCheckPPT.Visibility = Visibility.Visible; StackPanelPPTControls.Visibility = Visibility.Collapsed; - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; MessageBox.Show("未找到幻灯片"); @@ -245,6 +247,145 @@ namespace Ink_Canvas { private string pptName = null; + private void UpdatePPTBtnStyleSettingsStatus() { + var sopt = Settings.PowerPointSettings.PPTSButtonsOption.ToString(); + char[] soptc = sopt.ToCharArray(); + if (soptc[0] == '2') + { + PPTLSPageButton.Visibility = Visibility.Visible; + PPTRSPageButton.Visibility = Visibility.Visible; + } + else + { + PPTLSPageButton.Visibility = Visibility.Collapsed; + PPTRSPageButton.Visibility = Visibility.Collapsed; + } + if (soptc[2] == '2') + { + // 这里先堆一点屎山,没空用Resources了 + PPTBtnLSBorder.Background = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTBtnRSBorder.Background = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTBtnLSBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(82, 82, 91)); + PPTBtnRSBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(82, 82, 91)); + PPTLSPreviousButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTRSPreviousButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTLSNextButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTRSNextButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTLSPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRSPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTLSPageButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRSPageButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTLSNextButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRSNextButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + TextBlock.SetForeground(PPTLSPageButton, new SolidColorBrush(Colors.White)); + TextBlock.SetForeground(PPTRSPageButton, new SolidColorBrush(Colors.White)); + } + else + { + PPTBtnLSBorder.Background = new SolidColorBrush(Color.FromRgb(244, 244, 245)); + PPTBtnRSBorder.Background = new SolidColorBrush(Color.FromRgb(244, 244, 245)); + PPTBtnLSBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(161, 161, 170)); + PPTBtnRSBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(161, 161, 170)); + PPTLSPreviousButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTRSPreviousButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTLSNextButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTRSNextButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTLSPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRSPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTLSPageButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRSPageButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTLSNextButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRSNextButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + TextBlock.SetForeground(PPTLSPageButton, new SolidColorBrush(Color.FromRgb(24, 24, 27))); + TextBlock.SetForeground(PPTRSPageButton, new SolidColorBrush(Color.FromRgb(24, 24, 27))); + } + if (soptc[1] == '2') + { + PPTBtnLSBorder.Opacity = 0.5; + PPTBtnRSBorder.Opacity = 0.5; + } + else + { + PPTBtnLSBorder.Opacity = 1; + PPTBtnRSBorder.Opacity = 1; + } + + var bopt = Settings.PowerPointSettings.PPTBButtonsOption.ToString(); + char[] boptc = bopt.ToCharArray(); + if (boptc[0] == '2') + { + PPTLBPageButton.Visibility = Visibility.Visible; + PPTRBPageButton.Visibility = Visibility.Visible; + } + else + { + PPTLBPageButton.Visibility = Visibility.Collapsed; + PPTRBPageButton.Visibility = Visibility.Collapsed; + } + if (boptc[2] == '2') + { + // 这里先堆一点屎山,没空用Resources了 + PPTBtnLBBorder.Background = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTBtnRBBorder.Background = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTBtnLBBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(82, 82, 91)); + PPTBtnRBBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(82, 82, 91)); + PPTLBPreviousButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTRBPreviousButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTLBNextButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTRBNextButtonGeometry.Brush = new SolidColorBrush(Colors.White); + PPTLBPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRBPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTLBPageButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRBPageButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTLBNextButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + PPTRBNextButtonFeedbackBorder.Background = new SolidColorBrush(Colors.White); + TextBlock.SetForeground(PPTLBPageButton, new SolidColorBrush(Colors.White)); + TextBlock.SetForeground(PPTRBPageButton, new SolidColorBrush(Colors.White)); + } + else + { + PPTBtnLBBorder.Background = new SolidColorBrush(Color.FromRgb(244, 244, 245)); + PPTBtnRBBorder.Background = new SolidColorBrush(Color.FromRgb(244, 244, 245)); + PPTBtnLBBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(161, 161, 170)); + PPTBtnRBBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(161, 161, 170)); + PPTLBPreviousButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTRBPreviousButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTLBNextButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTRBNextButtonGeometry.Brush = new SolidColorBrush(Color.FromRgb(39, 39, 42)); + PPTLBPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRBPreviousButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTLBPageButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRBPageButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTLBNextButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + PPTRBNextButtonFeedbackBorder.Background = new SolidColorBrush(Color.FromRgb(24, 24, 27)); + TextBlock.SetForeground(PPTLBPageButton, new SolidColorBrush(Color.FromRgb(24, 24, 27))); + TextBlock.SetForeground(PPTRBPageButton, new SolidColorBrush(Color.FromRgb(24, 24, 27))); + } + if (boptc[1] == '2') + { + PPTBtnLBBorder.Opacity = 0.5; + PPTBtnRBBorder.Opacity = 0.5; + } + else + { + PPTBtnLBBorder.Opacity = 1; + PPTBtnRBBorder.Opacity = 1; + } + } + + private void UpdatePPTBtnDisplaySettingsStatus() { + var dopt = Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString(); + char[] doptc = dopt.ToCharArray(); + if (doptc[0] == '2') AnimationsHelper.ShowWithFadeIn(LeftBottomPanelForPPTNavigation); + else LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + if (doptc[1] == '2') AnimationsHelper.ShowWithFadeIn(RightBottomPanelForPPTNavigation); + else RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + if (doptc[2] == '2') AnimationsHelper.ShowWithFadeIn(LeftSidePanelForPPTNavigation); + else LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; + if (doptc[3] == '2') AnimationsHelper.ShowWithFadeIn(RightSidePanelForPPTNavigation); + else RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; + } + private async void PptApplication_SlideShowBegin(SlideShowWindow Wn) { if (Settings.Automation.IsAutoFoldInPPTSlideShow && !isFloatingBarFolded) await FoldFloatingBar(new object()); @@ -318,16 +459,25 @@ namespace Ink_Canvas { StackPanelPPTControls.Visibility = Visibility.Visible; - if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel && !isFloatingBarFolded) - AnimationsHelper.ShowWithSlideFromBottomAndFade(BottomViewboxPPTSidesControl); - else - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; - if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel && !isFloatingBarFolded) { - AnimationsHelper.ShowWithScaleFromLeft(LeftSidePanelForPPTNavigation); - AnimationsHelper.ShowWithScaleFromRight(RightSidePanelForPPTNavigation); - } else { - LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; - RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; + // -- old -- + //if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel && !isFloatingBarFolded) + // AnimationsHelper.ShowWithSlideFromBottomAndFade(BottomViewboxPPTSidesControl); + //else + // BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + + //if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel && !isFloatingBarFolded) { + + // AnimationsHelper.ShowWithScaleFromRight(RightSidePanelForPPTNavigation); + //} else { + // LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; + // RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; + //} + // -- old -- + + // -- new -- + if (!isFloatingBarFolded) { + UpdatePPTBtnDisplaySettingsStatus(); + UpdatePPTBtnStyleSettingsStatus(); } BtnPPTSlideShow.Visibility = Visibility.Collapsed; @@ -364,7 +514,8 @@ namespace Ink_Canvas { BtnColorRed_Click(null, null); isEnteredSlideShowEndEvent = false; - PptNavigationTextBlock.Text = $"{Wn.View.CurrentShowPosition}/{Wn.Presentation.Slides.Count}"; + PPTBtnPageNow.Text = $"{Wn.View.CurrentShowPosition}"; + PPTBtnPageTotal.Text = $"/ {Wn.Presentation.Slides.Count}"; LogHelper.NewLog("PowerPoint Slide Show Loading process complete"); if (!isFloatingBarFolded) { @@ -434,7 +585,8 @@ namespace Ink_Canvas { BtnPPTSlideShow.Visibility = Visibility.Visible; BtnPPTSlideShowEnd.Visibility = Visibility.Collapsed; StackPanelPPTControls.Visibility = Visibility.Collapsed; - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; @@ -497,7 +649,10 @@ namespace Ink_Canvas { // ignored } - PptNavigationTextBlock.Text = $"{Wn.View.CurrentShowPosition}/{Wn.Presentation.Slides.Count}"; + PPTBtnPageNow.Text = $"{Wn.View.CurrentShowPosition}"; + PPTBtnPageTotal.Text = $"/ {Wn.Presentation.Slides.Count}"; + + //PptNavigationTextBlock.Text = $"{Wn.View.CurrentShowPosition}/{Wn.Presentation.Slides.Count}"; }); previousSlideID = Wn.View.CurrentShowPosition; } @@ -540,7 +695,8 @@ namespace Ink_Canvas { } catch { StackPanelPPTControls.Visibility = Visibility.Collapsed; - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; } @@ -580,15 +736,75 @@ namespace Ink_Canvas { } catch { StackPanelPPTControls.Visibility = Visibility.Collapsed; - BottomViewboxPPTSidesControl.Visibility = Visibility.Collapsed; + LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; + RightBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed; LeftSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed; } } + private async void PPTNavigationBtn_MouseDown(object sender, MouseButtonEventArgs e) + { + lastBorderMouseDownObject = sender; + if (sender == PPTLSPageButton) + { + PPTLSPageButtonFeedbackBorder.Opacity = 0.15; + } + else if (sender == PPTRSPageButton) + { + PPTRSPageButtonFeedbackBorder.Opacity = 0.15; + } + else if (sender == PPTLBPageButton) + { + PPTLBPageButtonFeedbackBorder.Opacity = 0.15; + } + else if (sender == PPTRBPageButton) + { + PPTRBPageButtonFeedbackBorder.Opacity = 0.15; + } + } - private async void PPTNavigationBtn_Click(object sender, MouseButtonEventArgs e) { + private async void PPTNavigationBtn_MouseLeave(object sender, MouseEventArgs e) + { + lastBorderMouseDownObject = null; + if (sender == PPTLSPageButton) + { + PPTLSPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRSPageButton) + { + PPTRSPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTLBPageButton) + { + PPTLBPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBPageButton) + { + PPTRBPageButtonFeedbackBorder.Opacity = 0; + } + } + + private async void PPTNavigationBtn_MouseUp(object sender, MouseButtonEventArgs e) { if (lastBorderMouseDownObject != sender) return; + + if (sender == PPTLSPageButton) + { + PPTLSPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRSPageButton) + { + PPTRSPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTLBPageButton) + { + PPTLBPageButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBPageButton) + { + PPTRBPageButtonFeedbackBorder.Opacity = 0; + } + GridTransparencyFakeBackground.Opacity = 1; GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF")); CursorIcon_Click(null, null); @@ -640,13 +856,101 @@ namespace Ink_Canvas { ViewboxFloatingBarMarginAnimation(100, true); } + private void GridPPTControlPrevious_MouseDown(object sender, MouseButtonEventArgs e) + { + lastBorderMouseDownObject = sender; + if (sender == PPTLSPreviousButtonBorder) { + PPTLSPreviousButtonFeedbackBorder.Opacity = 0.15; + } else if (sender == PPTRSPreviousButtonBorder) { + PPTRSPreviousButtonFeedbackBorder.Opacity = 0.15; + } else if (sender == PPTLBPreviousButtonBorder) + { + PPTLBPreviousButtonFeedbackBorder.Opacity = 0.15; + } + else if (sender == PPTRBPreviousButtonBorder) + { + PPTRBPreviousButtonFeedbackBorder.Opacity = 0.15; + } + } + private void GridPPTControlPrevious_MouseLeave(object sender, MouseEventArgs e) + { + lastBorderMouseDownObject = null; + if (sender == PPTLSPreviousButtonBorder) { + PPTLSPreviousButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTRSPreviousButtonBorder) { + PPTRSPreviousButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTLBPreviousButtonBorder) + { + PPTLBPreviousButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBPreviousButtonBorder) + { + PPTRBPreviousButtonFeedbackBorder.Opacity = 0; + } + } private void GridPPTControlPrevious_MouseUp(object sender, MouseButtonEventArgs e) { if (lastBorderMouseDownObject != sender) return; + if (sender == PPTLSPreviousButtonBorder) { + PPTLSPreviousButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTRSPreviousButtonBorder) { + PPTRSPreviousButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTLBPreviousButtonBorder) + { + PPTLBPreviousButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBPreviousButtonBorder) + { + PPTRBPreviousButtonFeedbackBorder.Opacity = 0; + } BtnPPTSlidesUp_Click(BtnPPTSlidesUp, null); } + + private void GridPPTControlNext_MouseDown(object sender, MouseButtonEventArgs e) { + lastBorderMouseDownObject = sender; + if (sender == PPTLSNextButtonBorder) { + PPTLSNextButtonFeedbackBorder.Opacity = 0.15; + } else if (sender == PPTRSNextButtonBorder) { + PPTRSNextButtonFeedbackBorder.Opacity = 0.15; + } else if (sender == PPTLBNextButtonBorder) + { + PPTLBNextButtonFeedbackBorder.Opacity = 0.15; + } + else if (sender == PPTRBNextButtonBorder) + { + PPTRBNextButtonFeedbackBorder.Opacity = 0.15; + } + } + private void GridPPTControlNext_MouseLeave(object sender, MouseEventArgs e) + { + lastBorderMouseDownObject = null; + if (sender == PPTLSNextButtonBorder) { + PPTLSNextButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTRSNextButtonBorder) { + PPTRSNextButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTLBNextButtonBorder) + { + PPTLBNextButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBNextButtonBorder) + { + PPTRBNextButtonFeedbackBorder.Opacity = 0; + } + } private void GridPPTControlNext_MouseUp(object sender, MouseButtonEventArgs e) { if (lastBorderMouseDownObject != sender) return; + if (sender == PPTLSNextButtonBorder) { + PPTLSNextButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTRSNextButtonBorder) { + PPTRSNextButtonFeedbackBorder.Opacity = 0; + } else if (sender == PPTLBNextButtonBorder) + { + PPTLBNextButtonFeedbackBorder.Opacity = 0; + } + else if (sender == PPTRBNextButtonBorder) + { + PPTRBNextButtonFeedbackBorder.Opacity = 0; + } BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null); } diff --git a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs index 4ae6f01..b5cc24b 100644 --- a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs +++ b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; diff --git a/Ink Canvas/MainWindow_cs/MW_Settings.cs b/Ink Canvas/MainWindow_cs/MW_Settings.cs index 865f11f..e9c2fbb 100644 --- a/Ink Canvas/MainWindow_cs/MW_Settings.cs +++ b/Ink Canvas/MainWindow_cs/MW_Settings.cs @@ -295,42 +295,44 @@ namespace Ink_Canvas { LoadSettings(); } - [Obsolete] - private void ToggleSwitchShowButtonPPTNavigation_OnToggled(object sender, RoutedEventArgs e) { - if (!isLoaded) return; - Settings.PowerPointSettings.IsShowPPTNavigation = ToggleSwitchShowButtonPPTNavigation.IsOn; - PptNavigationBtn.Visibility = Settings.PowerPointSettings.IsShowPPTNavigation - ? Visibility.Visible - : Visibility.Collapsed; - SaveSettingsToFile(); - } + //[Obsolete] + //private void ToggleSwitchShowButtonPPTNavigation_OnToggled(object sender, RoutedEventArgs e) { + // if (!isLoaded) return; + // Settings.PowerPointSettings.IsShowPPTNavigation = ToggleSwitchShowButtonPPTNavigation.IsOn; + // var vis = Settings.PowerPointSettings.IsShowPPTNavigation ? Visibility.Visible : Visibility.Collapsed; + // PPTLBPageButton.Visibility = vis; + // PPTRBPageButton.Visibility = vis; + // PPTLSPageButton.Visibility = vis; + // PPTRSPageButton.Visibility = vis; + // SaveSettingsToFile(); + //} - [Obsolete] - private void ToggleSwitchShowBottomPPTNavigationPanel_OnToggled(object sender, RoutedEventArgs e) { - if (!isLoaded) return; - Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel = ToggleSwitchShowBottomPPTNavigationPanel.IsOn; - if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) - BottomViewboxPPTSidesControl.Visibility = Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel - ? Visibility.Visible - : Visibility.Collapsed; - SaveSettingsToFile(); - } + //[Obsolete] + //private void ToggleSwitchShowBottomPPTNavigationPanel_OnToggled(object sender, RoutedEventArgs e) { + // if (!isLoaded) return; + // Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel = ToggleSwitchShowBottomPPTNavigationPanel.IsOn; + // if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) + // //BottomViewboxPPTSidesControl.Visibility = Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel + // // ? Visibility.Visible + // // : Visibility.Collapsed; + // SaveSettingsToFile(); + //} - [Obsolete] - private void ToggleSwitchShowSidePPTNavigationPanel_OnToggled(object sender, RoutedEventArgs e) { - if (!isLoaded) return; - Settings.PowerPointSettings.IsShowSidePPTNavigationPanel = ToggleSwitchShowSidePPTNavigationPanel.IsOn; - if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) { - LeftSidePanelForPPTNavigation.Visibility = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel - ? Visibility.Visible - : Visibility.Collapsed; - RightSidePanelForPPTNavigation.Visibility = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel - ? Visibility.Visible - : Visibility.Collapsed; - } + //[Obsolete] + //private void ToggleSwitchShowSidePPTNavigationPanel_OnToggled(object sender, RoutedEventArgs e) { + // if (!isLoaded) return; + // Settings.PowerPointSettings.IsShowSidePPTNavigationPanel = ToggleSwitchShowSidePPTNavigationPanel.IsOn; + // if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) { + // LeftSidePanelForPPTNavigation.Visibility = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel + // ? Visibility.Visible + // : Visibility.Collapsed; + // RightSidePanelForPPTNavigation.Visibility = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel + // ? Visibility.Visible + // : Visibility.Collapsed; + // } - SaveSettingsToFile(); - } + // SaveSettingsToFile(); + //} private void ToggleSwitchShowPPTButton_OnToggled(object sender, RoutedEventArgs e) { if (!isLoaded) return; @@ -351,6 +353,7 @@ namespace Ink_Canvas { c[0] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnDisplaySettingsStatus(); } private void CheckboxEnableRBPPTButton_IsCheckChanged(object sender, RoutedEventArgs e) @@ -361,6 +364,7 @@ namespace Ink_Canvas { c[1] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnDisplaySettingsStatus(); } private void CheckboxEnableLSPPTButton_IsCheckChanged(object sender, RoutedEventArgs e) @@ -371,6 +375,7 @@ namespace Ink_Canvas { c[2] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnDisplaySettingsStatus(); } private void CheckboxEnableRSPPTButton_IsCheckChanged(object sender, RoutedEventArgs e) @@ -381,6 +386,7 @@ namespace Ink_Canvas { c[3] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnDisplaySettingsStatus(); } private void CheckboxSPPTDisplayPage_IsCheckChange(object sender, RoutedEventArgs e) @@ -391,6 +397,7 @@ namespace Ink_Canvas { c[0] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTSButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } private void CheckboxSPPTHalfOpacity_IsCheckChange(object sender, RoutedEventArgs e) @@ -401,6 +408,7 @@ namespace Ink_Canvas { c[1] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTSButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } private void CheckboxSPPTBlackBackground_IsCheckChange(object sender, RoutedEventArgs e) @@ -411,6 +419,7 @@ namespace Ink_Canvas { c[2] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTSButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } private void CheckboxBPPTDisplayPage_IsCheckChange(object sender, RoutedEventArgs e) @@ -421,9 +430,10 @@ namespace Ink_Canvas { c[0] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTBButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } - private void CheckboxBPPTSHalfOpacity_IsCheckChange(object sender, RoutedEventArgs e) + private void CheckboxBPPTHalfOpacity_IsCheckChange(object sender, RoutedEventArgs e) { if (!isLoaded) return; var str = Settings.PowerPointSettings.PPTBButtonsOption.ToString(); @@ -431,9 +441,10 @@ namespace Ink_Canvas { c[1] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTBButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } - private void CheckboxBPPTSBlackBackground_IsCheckChange(object sender, RoutedEventArgs e) + private void CheckboxBPPTBlackBackground_IsCheckChange(object sender, RoutedEventArgs e) { if (!isLoaded) return; var str = Settings.PowerPointSettings.PPTBButtonsOption.ToString(); @@ -441,6 +452,7 @@ namespace Ink_Canvas { c[2] = (bool)((CheckBox)sender).IsChecked ? '2' : '1'; Settings.PowerPointSettings.PPTBButtonsOption = int.Parse(new string(c)); SaveSettingsToFile(); + UpdatePPTBtnStyleSettingsStatus(); } private void PPTButtonLeftPositionValueSlider_ValueChanged(object sender, RoutedEventArgs e) { @@ -1287,9 +1299,9 @@ namespace Ink_Canvas { Settings.Automation.AutoDelSavedFiles = AutoDelSavedFilesDays; Settings.Automation.AutoDelSavedFilesDaysThreshold = AutoDelSavedFilesDaysThreshold; - Settings.PowerPointSettings.IsShowPPTNavigation = true; - Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel = false; - Settings.PowerPointSettings.IsShowSidePPTNavigationPanel = true; + //Settings.PowerPointSettings.IsShowPPTNavigation = true; + //Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel = false; + //Settings.PowerPointSettings.IsShowSidePPTNavigationPanel = true; Settings.PowerPointSettings.PowerPointSupport = true; Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow = false; Settings.PowerPointSettings.IsNoClearStrokeOnSelectWhenInPowerPoint = true; diff --git a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs index c4dd407..1dc6f80 100644 --- a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs +++ b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs @@ -259,13 +259,8 @@ namespace Ink_Canvas { // PowerPointSettings if (Settings.PowerPointSettings != null) { - PptNavigationBtn.Visibility = Settings.PowerPointSettings.IsShowPPTNavigation - ? Visibility.Visible - : Visibility.Collapsed; - ToggleSwitchShowButtonPPTNavigation.IsOn = Settings.PowerPointSettings.IsShowPPTNavigation; - ToggleSwitchShowBottomPPTNavigationPanel.IsOn = - Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel; - ToggleSwitchShowSidePPTNavigationPanel.IsOn = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel; + + if (Settings.PowerPointSettings.PowerPointSupport) { ToggleSwitchSupportPowerPoint.IsOn = true; timerCheckPPT.Start(); diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs index f694869..ad524af 100644 --- a/Ink Canvas/Resources/Settings.cs +++ b/Ink Canvas/Resources/Settings.cs @@ -153,17 +153,6 @@ namespace Ink_Canvas public class PowerPointSettings { - [JsonProperty("isShowPPTNavigation")] - - // -- old -- - public bool IsShowPPTNavigation { get; set; } = true; - [JsonProperty("isShowBottomPPTNavigationPanel")] - public bool IsShowBottomPPTNavigationPanel { get; set; } = true; - [JsonProperty("isShowSidePPTNavigationPanel")] - public bool IsShowSidePPTNavigationPanel { get; set; } = true; - - // -- old -- - // -- new -- [JsonProperty("showPPTButton")]