diff --git a/Ink Canvas/Controls/FixedAspectRatioPanel.cs b/Ink Canvas/Controls/FixedAspectRatioPanel.cs
new file mode 100644
index 00000000..02ac0d97
--- /dev/null
+++ b/Ink Canvas/Controls/FixedAspectRatioPanel.cs
@@ -0,0 +1,77 @@
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Controls
+{
+ ///
+ /// 在父容器可用空间内计算最大的固定宽高比矩形,
+ /// 子元素按真实布局尺寸排列(无任何缩放变换),多余空间居中留白。
+ ///
+ public class FixedAspectRatioPanel : Panel
+ {
+ public double AspectRatio
+ {
+ get => (double)GetValue(AspectRatioProperty);
+ set => SetValue(AspectRatioProperty, value);
+ }
+
+ public static readonly DependencyProperty AspectRatioProperty =
+ DependencyProperty.Register(
+ nameof(AspectRatio),
+ typeof(double),
+ typeof(FixedAspectRatioPanel),
+ new PropertyMetadata(16.0 / 9.0, (d, _) => ((FixedAspectRatioPanel)d).InvalidateMeasure()));
+
+ protected override Size MeasureOverride(Size availableSize)
+ {
+ double ratio = AspectRatio;
+ double contentWidth, contentHeight;
+
+ double widthByHeight = availableSize.Height * ratio;
+ if (widthByHeight <= availableSize.Width)
+ {
+ contentWidth = widthByHeight;
+ contentHeight = availableSize.Height;
+ }
+ else
+ {
+ contentWidth = availableSize.Width;
+ contentHeight = availableSize.Width / ratio;
+ }
+
+ if (double.IsInfinity(contentWidth)) contentWidth = 0;
+ if (double.IsInfinity(contentHeight)) contentHeight = 0;
+
+ foreach (UIElement child in InternalChildren)
+ child.Measure(new Size(contentWidth, contentHeight));
+
+ return new Size(contentWidth, contentHeight);
+ }
+
+ protected override Size ArrangeOverride(Size finalSize)
+ {
+ double ratio = AspectRatio;
+ double contentWidth, contentHeight;
+
+ double widthByHeight = finalSize.Height * ratio;
+ if (widthByHeight <= finalSize.Width)
+ {
+ contentWidth = widthByHeight;
+ contentHeight = finalSize.Height;
+ }
+ else
+ {
+ contentWidth = finalSize.Width;
+ contentHeight = finalSize.Width / ratio;
+ }
+
+ double left = (finalSize.Width - contentWidth) / 2;
+ double top = (finalSize.Height - contentHeight) / 2;
+
+ foreach (UIElement child in InternalChildren)
+ child.Arrange(new Rect(left, top, contentWidth, contentHeight));
+
+ return finalSize;
+ }
+ }
+}
diff --git a/Ink Canvas/Helpers/PPTUIManager.cs b/Ink Canvas/Helpers/PPTUIManager.cs
index 74f299b5..6194fda6 100644
--- a/Ink Canvas/Helpers/PPTUIManager.cs
+++ b/Ink Canvas/Helpers/PPTUIManager.cs
@@ -15,6 +15,14 @@ public class PPTUIManager
public int PPTButtonsDisplayOption { get; set; } = 2222;
public int PPTSButtonsOption { get; set; } = 221;
public int PPTBButtonsOption { get; set; } = 121;
+ public bool PPTLSButtonShowPageNumber { get; set; } = true;
+ public bool PPTRSButtonShowPageNumber { get; set; } = true;
+ public bool PPTLBButtonShowPageNumber { get; set; } = false;
+ public bool PPTRBButtonShowPageNumber { get; set; } = false;
+ public bool PPTLSButtonBlackBackground { get; set; } = false;
+ public bool PPTRSButtonBlackBackground { get; set; } = false;
+ public bool PPTLBButtonBlackBackground { get; set; } = false;
+ public bool PPTRBButtonBlackBackground { get; set; } = false;
public int PPTLSButtonPosition { get; set; } = 0;
public int PPTRSButtonPosition { get; set; } = 0;
public int PPTLBButtonPosition { get; set; } = 0;
@@ -256,7 +264,7 @@ public void UpdateNavigationPanelsVisibility()
_mainWindow.RightBottomPanelForPPTNavigation.Margin = new Thickness(0, 0, 6 + PPTRBButtonPosition, 6);
// 根据显示选项设置面板可见性
- var displayOption = PPTButtonsDisplayOption.ToString();
+ var displayOption = PPTButtonsDisplayOption.ToString().PadLeft(4, '1');
if (displayOption.Length >= 4)
{
var options = displayOption.ToCharArray();
@@ -400,24 +408,17 @@ private void UpdateSideButtonStyles()
{
try
{
- var sideOption = PPTSButtonsOption.ToString();
- if (sideOption.Length < 3) return;
-
- var options = sideOption.ToCharArray();
-
- // 页码按钮显示
- var pageButtonVisibility = options[0] == '2' ? Visibility.Visible : Visibility.Collapsed;
- _mainWindow.LeftSidePanelForPPTNavigation.SetPageButtonVisibility(pageButtonVisibility);
- _mainWindow.RightSidePanelForPPTNavigation.SetPageButtonVisibility(pageButtonVisibility);
-
- // 透明度
+ // 左侧按钮
+ _mainWindow.LeftSidePanelForPPTNavigation.SetPageButtonVisibility(
+ PPTLSButtonShowPageNumber ? Visibility.Visible : Visibility.Collapsed);
_mainWindow.LeftSidePanelForPPTNavigation.SetBarOpacity(PPTLSButtonOpacity);
- _mainWindow.RightSidePanelForPPTNavigation.SetBarOpacity(PPTRSButtonOpacity);
+ _mainWindow.LeftSidePanelForPPTNavigation.ApplyTheme(PPTLSButtonBlackBackground);
- // 颜色主题
- bool isDarkTheme = options[2] == '2';
- _mainWindow.LeftSidePanelForPPTNavigation.ApplyTheme(isDarkTheme);
- _mainWindow.RightSidePanelForPPTNavigation.ApplyTheme(isDarkTheme);
+ // 右侧按钮
+ _mainWindow.RightSidePanelForPPTNavigation.SetPageButtonVisibility(
+ PPTRSButtonShowPageNumber ? Visibility.Visible : Visibility.Collapsed);
+ _mainWindow.RightSidePanelForPPTNavigation.SetBarOpacity(PPTRSButtonOpacity);
+ _mainWindow.RightSidePanelForPPTNavigation.ApplyTheme(PPTRSButtonBlackBackground);
}
catch (Exception ex)
{
@@ -429,24 +430,17 @@ private void UpdateBottomButtonStyles()
{
try
{
- var bottomOption = PPTBButtonsOption.ToString();
- if (bottomOption.Length < 3) return;
-
- var options = bottomOption.ToCharArray();
-
- // 页码按钮显示
- var pageButtonVisibility = options[0] == '2' ? Visibility.Visible : Visibility.Collapsed;
- _mainWindow.LeftBottomPanelForPPTNavigation.SetPageButtonVisibility(pageButtonVisibility);
- _mainWindow.RightBottomPanelForPPTNavigation.SetPageButtonVisibility(pageButtonVisibility);
-
- // 透明度
+ // 左下按钮
+ _mainWindow.LeftBottomPanelForPPTNavigation.SetPageButtonVisibility(
+ PPTLBButtonShowPageNumber ? Visibility.Visible : Visibility.Collapsed);
_mainWindow.LeftBottomPanelForPPTNavigation.SetBarOpacity(PPTLBButtonOpacity);
- _mainWindow.RightBottomPanelForPPTNavigation.SetBarOpacity(PPTRBButtonOpacity);
+ _mainWindow.LeftBottomPanelForPPTNavigation.ApplyTheme(PPTLBButtonBlackBackground);
- // 颜色主题
- bool isDarkTheme = options[2] == '2';
- _mainWindow.LeftBottomPanelForPPTNavigation.ApplyTheme(isDarkTheme);
- _mainWindow.RightBottomPanelForPPTNavigation.ApplyTheme(isDarkTheme);
+ // 右下按钮
+ _mainWindow.RightBottomPanelForPPTNavigation.SetPageButtonVisibility(
+ PPTRBButtonShowPageNumber ? Visibility.Visible : Visibility.Collapsed);
+ _mainWindow.RightBottomPanelForPPTNavigation.SetBarOpacity(PPTRBButtonOpacity);
+ _mainWindow.RightBottomPanelForPPTNavigation.ApplyTheme(PPTRBButtonBlackBackground);
}
catch (Exception ex)
{
diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs
index eab761db..bcf9e762 100644
--- a/Ink Canvas/MainWindow_cs/MW_PPT.cs
+++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs
@@ -314,6 +314,7 @@ public void InitializePPTManagers()
// 初始化UI管理器
_pptUIManager = new PPTUIManager(this);
+ Settings.PowerPointSettings.MigrateLegacyButtonOptions();
_pptUIManager.ShowPPTButton = Settings.PowerPointSettings.ShowPPTButton;
_pptUIManager.PPTButtonsDisplayOption = Settings.PowerPointSettings.PPTButtonsDisplayOption;
_pptUIManager.PPTSButtonsOption = Settings.PowerPointSettings.PPTSButtonsOption;
@@ -324,6 +325,19 @@ public void InitializePPTManagers()
_pptUIManager.PPTRBButtonPosition = Settings.PowerPointSettings.PPTRBButtonPosition;
_pptUIManager.EnablePPTButtonPageClickable = Settings.PowerPointSettings.EnablePPTButtonPageClickable;
_pptUIManager.EnablePPTButtonLongPressPageTurn = Settings.PowerPointSettings.EnablePPTButtonLongPressPageTurn;
+ _pptUIManager.PPTLSButtonOpacity = Settings.PowerPointSettings.PPTLSButtonOpacity;
+ _pptUIManager.PPTRSButtonOpacity = Settings.PowerPointSettings.PPTRSButtonOpacity;
+ _pptUIManager.PPTLBButtonOpacity = Settings.PowerPointSettings.PPTLBButtonOpacity;
+ _pptUIManager.PPTRBButtonOpacity = Settings.PowerPointSettings.PPTRBButtonOpacity;
+ _pptUIManager.PPTLSButtonShowPageNumber = Settings.PowerPointSettings.PPTLSButtonShowPageNumber;
+ _pptUIManager.PPTRSButtonShowPageNumber = Settings.PowerPointSettings.PPTRSButtonShowPageNumber;
+ _pptUIManager.PPTLBButtonShowPageNumber = Settings.PowerPointSettings.PPTLBButtonShowPageNumber;
+ _pptUIManager.PPTRBButtonShowPageNumber = Settings.PowerPointSettings.PPTRBButtonShowPageNumber;
+ _pptUIManager.PPTLSButtonBlackBackground = Settings.PowerPointSettings.PPTLSButtonBlackBackground;
+ _pptUIManager.PPTRSButtonBlackBackground = Settings.PowerPointSettings.PPTRSButtonBlackBackground;
+ _pptUIManager.PPTLBButtonBlackBackground = Settings.PowerPointSettings.PPTLBButtonBlackBackground;
+ _pptUIManager.PPTRBButtonBlackBackground = Settings.PowerPointSettings.PPTRBButtonBlackBackground;
+ _pptUIManager.PPTNavBarScale = Settings.PowerPointSettings.PPTNavBarScale;
LogHelper.WriteLogToFile("PPT管理器初始化完成", LogHelper.LogType.Event);
}
diff --git a/Ink Canvas/MainWindow_cs/MW_Settings.cs b/Ink Canvas/MainWindow_cs/MW_Settings.cs
index 299af31f..6e2f7a8d 100644
--- a/Ink Canvas/MainWindow_cs/MW_Settings.cs
+++ b/Ink Canvas/MainWindow_cs/MW_Settings.cs
@@ -500,6 +500,7 @@ public void UpdatePPTUIManagerSettings()
{
if (_pptUIManager != null && IsInPPTPresentationMode)
{
+ Settings.PowerPointSettings.MigrateLegacyButtonOptions();
_pptUIManager.PPTButtonsDisplayOption = Settings.PowerPointSettings.PPTButtonsDisplayOption;
_pptUIManager.PPTSButtonsOption = Settings.PowerPointSettings.PPTSButtonsOption;
_pptUIManager.PPTBButtonsOption = Settings.PowerPointSettings.PPTBButtonsOption;
@@ -513,6 +514,14 @@ public void UpdatePPTUIManagerSettings()
_pptUIManager.PPTRSButtonOpacity = Settings.PowerPointSettings.PPTRSButtonOpacity;
_pptUIManager.PPTLBButtonOpacity = Settings.PowerPointSettings.PPTLBButtonOpacity;
_pptUIManager.PPTRBButtonOpacity = Settings.PowerPointSettings.PPTRBButtonOpacity;
+ _pptUIManager.PPTLSButtonShowPageNumber = Settings.PowerPointSettings.PPTLSButtonShowPageNumber;
+ _pptUIManager.PPTRSButtonShowPageNumber = Settings.PowerPointSettings.PPTRSButtonShowPageNumber;
+ _pptUIManager.PPTLBButtonShowPageNumber = Settings.PowerPointSettings.PPTLBButtonShowPageNumber;
+ _pptUIManager.PPTRBButtonShowPageNumber = Settings.PowerPointSettings.PPTRBButtonShowPageNumber;
+ _pptUIManager.PPTLSButtonBlackBackground = Settings.PowerPointSettings.PPTLSButtonBlackBackground;
+ _pptUIManager.PPTRSButtonBlackBackground = Settings.PowerPointSettings.PPTRSButtonBlackBackground;
+ _pptUIManager.PPTLBButtonBlackBackground = Settings.PowerPointSettings.PPTLBButtonBlackBackground;
+ _pptUIManager.PPTRBButtonBlackBackground = Settings.PowerPointSettings.PPTRBButtonBlackBackground;
_pptUIManager.PPTNavBarScale = Settings.PowerPointSettings.PPTNavBarScale;
_pptUIManager.UpdateNavigationPanelsVisibility();
_pptUIManager.UpdateNavigationButtonStyles();
diff --git a/Ink Canvas/Properties/PPTStrings.Designer.cs b/Ink Canvas/Properties/PPTStrings.Designer.cs
index 540daf4d..82334a90 100644
--- a/Ink Canvas/Properties/PPTStrings.Designer.cs
+++ b/Ink Canvas/Properties/PPTStrings.Designer.cs
@@ -68,6 +68,16 @@ public static string GetString(string key)
public static string FlipButtonsScale => ResourceManager.GetString(nameof(FlipButtonsScale), _resourceCulture);
+ public static string FlipButtonsSettingHint => ResourceManager.GetString(nameof(FlipButtonsSettingHint), _resourceCulture);
+
+ public static string Configure => ResourceManager.GetString(nameof(Configure), _resourceCulture);
+
+ public static string GlobalSettings => ResourceManager.GetString(nameof(GlobalSettings), _resourceCulture);
+
+ public static string Positions => ResourceManager.GetString(nameof(Positions), _resourceCulture);
+
+ public static string EnablePositionButton => ResourceManager.GetString(nameof(EnablePositionButton), _resourceCulture);
+
public static string GoToFirstPageOnReenter => ResourceManager.GetString(nameof(GoToFirstPageOnReenter), _resourceCulture);
public static string GroupTitle => ResourceManager.GetString(nameof(GroupTitle), _resourceCulture);
diff --git a/Ink Canvas/Properties/PPTStrings.en-US.resx b/Ink Canvas/Properties/PPTStrings.en-US.resx
index 21a283da..802b5c63 100644
--- a/Ink Canvas/Properties/PPTStrings.en-US.resx
+++ b/Ink Canvas/Properties/PPTStrings.en-US.resx
@@ -84,6 +84,21 @@
Page-turn button size
+
+ Configure the position, appearance, and behavior of page-turn buttons
+
+
+ Configure
+
+
+ Global settings
+
+
+ Display positions
+
+
+ Enable {0} button
+
Go to first slide when starting a slideshow
diff --git a/Ink Canvas/Properties/PPTStrings.resx b/Ink Canvas/Properties/PPTStrings.resx
index 4e15d78d..2b7ba71f 100644
--- a/Ink Canvas/Properties/PPTStrings.resx
+++ b/Ink Canvas/Properties/PPTStrings.resx
@@ -84,6 +84,21 @@
翻页按钮大小
+
+ 配置翻页按钮的位置、外观与行为
+
+
+ 配置
+
+
+ 全局设置
+
+
+ 显示位置
+
+
+ 启用{0}按钮
+
进入放映时回到首页
diff --git a/Ink Canvas/Properties/PPTStrings.zh-ME.resx b/Ink Canvas/Properties/PPTStrings.zh-ME.resx
index 4fdcd701..84756351 100644
--- a/Ink Canvas/Properties/PPTStrings.zh-ME.resx
+++ b/Ink Canvas/Properties/PPTStrings.zh-ME.resx
@@ -1,4 +1,4 @@
-
+
@@ -84,6 +84,21 @@
翻页按钮大小
+
+ 配置翻页按钮的位置、外观和行为
+
+
+ 配置
+
+
+ 全局设置
+
+
+ 显示位置
+
+
+ 启用{0}按钮
+
进放映时回到首页
diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs
index 9ef08cf9..8d93e2a3 100644
--- a/Ink Canvas/Resources/Settings.cs
+++ b/Ink Canvas/Resources/Settings.cs
@@ -683,6 +683,30 @@ public class PowerPointSettings
[JsonProperty("pptBButtonsOption")]
public int PPTBButtonsOption { get; set; } = 121;
+ [JsonProperty("pptLSButtonShowPageNumber")]
+ public bool PPTLSButtonShowPageNumber { get; set; } = true;
+
+ [JsonProperty("pptRSButtonShowPageNumber")]
+ public bool PPTRSButtonShowPageNumber { get; set; } = true;
+
+ [JsonProperty("pptLBButtonShowPageNumber")]
+ public bool PPTLBButtonShowPageNumber { get; set; } = false;
+
+ [JsonProperty("pptRBButtonShowPageNumber")]
+ public bool PPTRBButtonShowPageNumber { get; set; } = false;
+
+ [JsonProperty("pptLSButtonBlackBackground")]
+ public bool PPTLSButtonBlackBackground { get; set; } = false;
+
+ [JsonProperty("pptRSButtonBlackBackground")]
+ public bool PPTRSButtonBlackBackground { get; set; } = false;
+
+ [JsonProperty("pptLBButtonBlackBackground")]
+ public bool PPTLBButtonBlackBackground { get; set; } = false;
+
+ [JsonProperty("pptRBButtonBlackBackground")]
+ public bool PPTRBButtonBlackBackground { get; set; } = false;
+
[JsonProperty("enablePPTButtonPageClickable")]
public bool EnablePPTButtonPageClickable { get; set; } = true;
@@ -707,6 +731,86 @@ public class PowerPointSettings
[JsonProperty("pptNavBarScale")]
public double PPTNavBarScale { get; set; } = 1.0;
+ private bool _hasMigratedButtonOptions = false;
+
+ public string GetPPTButtonsDisplayOptionString()
+ {
+ return PPTButtonsDisplayOption.ToString().PadLeft(4, '1');
+ }
+
+ public void MigrateLegacyButtonOptions()
+ {
+ if (_hasMigratedButtonOptions) return;
+ _hasMigratedButtonOptions = true;
+
+ bool changed = false;
+
+ var dispOpt = PPTButtonsDisplayOption.ToString();
+ if (dispOpt.Length < 4)
+ {
+ PPTButtonsDisplayOption = int.Parse(dispOpt.PadLeft(4, '1'));
+ changed = true;
+ dispOpt = PPTButtonsDisplayOption.ToString();
+ }
+
+ if (dispOpt.Length >= 4)
+ {
+ bool hasAnyEnabled = dispOpt[0] == '2' || dispOpt[1] == '2' || dispOpt[2] == '2' || dispOpt[3] == '2';
+ if (!hasAnyEnabled)
+ {
+ PPTButtonsDisplayOption = 2222;
+ changed = true;
+ }
+ }
+
+ var sideOpt = PPTSButtonsOption.ToString();
+ if (sideOpt.Length >= 3)
+ {
+ bool sideShowPage = sideOpt[0] == '2';
+ bool sideBlackBg = sideOpt[2] == '2';
+ if (PPTLSButtonShowPageNumber == true && PPTRSButtonShowPageNumber == true)
+ {
+ PPTLSButtonShowPageNumber = sideShowPage;
+ PPTRSButtonShowPageNumber = sideShowPage;
+ changed = true;
+ }
+ if (PPTLSButtonBlackBackground == false && PPTRSButtonBlackBackground == false)
+ {
+ PPTLSButtonBlackBackground = sideBlackBg;
+ PPTRSButtonBlackBackground = sideBlackBg;
+ changed = true;
+ }
+ }
+
+ var bottomOpt = PPTBButtonsOption.ToString();
+ if (bottomOpt.Length >= 3)
+ {
+ bool bottomShowPage = bottomOpt[0] == '2';
+ bool bottomBlackBg = bottomOpt[2] == '2';
+ if (PPTLBButtonShowPageNumber == false && PPTRBButtonShowPageNumber == false)
+ {
+ PPTLBButtonShowPageNumber = bottomShowPage;
+ PPTRBButtonShowPageNumber = bottomShowPage;
+ changed = true;
+ }
+ if (PPTLBButtonBlackBackground == false && PPTRBButtonBlackBackground == false)
+ {
+ PPTLBButtonBlackBackground = bottomBlackBg;
+ PPTRBButtonBlackBackground = bottomBlackBg;
+ changed = true;
+ }
+ }
+
+ if (changed)
+ {
+ try
+ {
+ Windows.SettingsViews.Helpers.SettingsManager.SaveSettingsToFile();
+ }
+ catch { }
+ }
+ }
+
// -- new --
[JsonProperty("powerPointSupport")]
diff --git a/Ink Canvas/Windows/SettingsViews/Helpers/SettingsActionHub.cs b/Ink Canvas/Windows/SettingsViews/Helpers/SettingsActionHub.cs
index 19f3c973..31e70987 100644
--- a/Ink Canvas/Windows/SettingsViews/Helpers/SettingsActionHub.cs
+++ b/Ink Canvas/Windows/SettingsViews/Helpers/SettingsActionHub.cs
@@ -635,6 +635,46 @@ public static void OnPPTBButtonsOptionChanged()
mw?.UpdatePPTBtnPreview();
}
+ public static void OnPPTButtonShowPageNumberChanged(string buttonKey, bool value)
+ {
+ var mw = GetMainWindow();
+ if (mw?.PPTUIManager != null)
+ {
+ switch (buttonKey)
+ {
+ case "LS": mw.PPTUIManager.PPTLSButtonShowPageNumber = value; break;
+ case "RS": mw.PPTUIManager.PPTRSButtonShowPageNumber = value; break;
+ case "LB": mw.PPTUIManager.PPTLBButtonShowPageNumber = value; break;
+ case "RB": mw.PPTUIManager.PPTRBButtonShowPageNumber = value; break;
+ }
+ if (mw.IsInPPTPresentationMode)
+ {
+ mw.PPTUIManager.UpdateNavigationButtonStyles();
+ }
+ }
+ mw?.UpdatePPTBtnPreview();
+ }
+
+ public static void OnPPTButtonBlackBackgroundChanged(string buttonKey, bool value)
+ {
+ var mw = GetMainWindow();
+ if (mw?.PPTUIManager != null)
+ {
+ switch (buttonKey)
+ {
+ case "LS": mw.PPTUIManager.PPTLSButtonBlackBackground = value; break;
+ case "RS": mw.PPTUIManager.PPTRSButtonBlackBackground = value; break;
+ case "LB": mw.PPTUIManager.PPTLBButtonBlackBackground = value; break;
+ case "RB": mw.PPTUIManager.PPTRBButtonBlackBackground = value; break;
+ }
+ if (mw.IsInPPTPresentationMode)
+ {
+ mw.PPTUIManager.UpdateNavigationButtonStyles();
+ }
+ }
+ mw?.UpdatePPTBtnPreview();
+ }
+
public static void OnPPTBButtonsOptionWithOpacityChanged()
{
var mw = GetMainWindow();
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/BoardMenuPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/BoardMenuPage.xaml
index 2f077cad..1333b6b3 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/BoardMenuPage.xaml
+++ b/Ink Canvas/Windows/SettingsViews/Pages/BoardMenuPage.xaml
@@ -168,6 +168,6 @@
+ HorizontalAlignment="Left" Margin="0,12,0,16"/>
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/BoardToolbarPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/BoardToolbarPage.xaml
index 2d5d18ba..b13b0adc 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/BoardToolbarPage.xaml
+++ b/Ink Canvas/Windows/SettingsViews/Pages/BoardToolbarPage.xaml
@@ -12,7 +12,8 @@
xmlns:board="clr-namespace:Ink_Canvas.Controls.Toolbar.BoardToolbar"
xmlns:touch="clr-namespace:Ink_Canvas.Helpers"
mc:Ignorable="d"
- Title="{x:Static props:FloatingBarStrings.BoardToolbarPage_Title}">
+ Title="{x:Static props:FloatingBarStrings.BoardToolbarPage_Title}"
+ d:Height="1080" d:Width="1920">
@@ -173,28 +174,28 @@
-
-
+
@@ -368,7 +369,7 @@
+ HorizontalAlignment="Left"/>
@@ -377,6 +378,6 @@
+ HorizontalAlignment="Left" Margin="0,12,0,16"/>
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml
new file mode 100644
index 00000000..a85ae85e
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml.cs
new file mode 100644
index 00000000..27649966
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/Pages/PPTFlipButtonSettingsPage.xaml.cs
@@ -0,0 +1,494 @@
+using Ink_Canvas.Controls;
+using Ink_Canvas.Helpers;
+using Ink_Canvas.Windows.SettingsViews.Helpers;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using Page = iNKORE.UI.WPF.Modern.Controls.Page;
+
+namespace Ink_Canvas.Windows.SettingsViews.Pages
+{
+ public partial class PPTFlipButtonSettingsPage : Page
+ {
+ private bool _isLoaded = false;
+ private bool _isSyncingPosition = false;
+ private DelayAction _sliderDelayAction = new DelayAction();
+ private PPTNavBar.NavDirection _selectedDirection = PPTNavBar.NavDirection.LeftSide;
+ private iNKORE.UI.WPF.Modern.Controls.NavigationView _cachedNavigationView;
+ private iNKORE.UI.WPF.Modern.Controls.NavigationViewPaneDisplayMode _previousPaneDisplayMode
+ = iNKORE.UI.WPF.Modern.Controls.NavigationViewPaneDisplayMode.Auto;
+
+ public PPTFlipButtonSettingsPage()
+ {
+ InitializeComponent();
+ Loaded += PPTFlipButtonSettingsPage_Loaded;
+ Unloaded += PPTFlipButtonSettingsPage_Unloaded;
+ }
+
+ private void PPTFlipButtonSettingsPage_Loaded(object sender, RoutedEventArgs e)
+ {
+ LoadSettings();
+
+ // 先同步 ComboBox 选中项(不触发 SelectionChanged),再显示设置面板
+ _isSyncingPosition = true;
+ ComboBoxPosition.SelectedIndex = _selectedDirection switch
+ {
+ PPTNavBar.NavDirection.LeftSide => 0,
+ PPTNavBar.NavDirection.RightSide => 1,
+ PPTNavBar.NavDirection.LeftBottom => 2,
+ PPTNavBar.NavDirection.RightBottom => 3,
+ _ => 0
+ };
+ _isSyncingPosition = false;
+ SelectPosition(_selectedDirection);
+
+ _isLoaded = true;
+ UpdateAllSliderTexts();
+ UpdatePreview();
+ SliderTouchHelper.AddTouchSupportToAllSliders(this);
+
+ // 进入本页时把导航栏切到 LeftMinimal,给预览更多空间
+ var settingsWindow = Window.GetWindow(this) as SettingsViews.SettingsWindow;
+ var navView = settingsWindow?.NavigationViewControl;
+ if (navView != null)
+ {
+ _cachedNavigationView = navView;
+ // 仅在当前不是 LeftMinimal 时记录原模式,避免重复进入时覆盖
+ if (navView.PaneDisplayMode != iNKORE.UI.WPF.Modern.Controls.NavigationViewPaneDisplayMode.LeftMinimal)
+ {
+ _previousPaneDisplayMode = navView.PaneDisplayMode;
+ }
+ navView.PaneDisplayMode = iNKORE.UI.WPF.Modern.Controls.NavigationViewPaneDisplayMode.LeftMinimal;
+ }
+ }
+
+ private void PPTFlipButtonSettingsPage_Unloaded(object sender, RoutedEventArgs e)
+ {
+ _isLoaded = false;
+
+ // 离开本页时恢复原 PaneDisplayMode(使用缓存引用,不依赖 Window.GetWindow)
+ if (_cachedNavigationView != null)
+ {
+ _cachedNavigationView.PaneDisplayMode = _previousPaneDisplayMode;
+ _cachedNavigationView = null;
+ }
+ }
+
+ private void PPTFlipButtonSettingsPage_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ UpdatePreview();
+ }
+
+ ///
+ /// PreviewCanvas 尺寸变化(FixedAspectRatioPanel 完成排列)后重算 4 个 Border 的 Margin。
+ ///
+ private void PreviewCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ UpdatePreview();
+ }
+
+ private void LoadSettings()
+ {
+ _isLoaded = false;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+
+ CardShowPPTButton.IsOn = ppt.ShowPPTButton;
+ PPTNavBarScaleValueSlider.Value = ppt.PPTNavBarScale;
+ CardEnablePPTButtonPageClickable.IsOn = ppt.EnablePPTButtonPageClickable;
+ CardEnablePPTButtonEnhancedPreview.IsOn = ppt.EnablePPTButtonEnhancedPreview;
+ CardEnablePPTButtonLongPressPageTurn.IsOn = ppt.EnablePPTButtonLongPressPageTurn;
+
+ _isLoaded = true;
+
+ UpdatePreview();
+ }
+
+ private void UpdateAllSliderTexts()
+ {
+ UpdateSliderText(OffsetSlider, OffsetText, "{0:F0}");
+ UpdateSliderText(OpacitySlider, OpacityText, "{0:P0}");
+ UpdateSliderText(PPTNavBarScaleValueSlider, PPTNavBarScaleText, "{0:F2}");
+ }
+
+ private void UpdateSliderText(Slider slider, TextBlock textBlock, string format)
+ {
+ if (slider == null || textBlock == null) return;
+ textBlock.Text = string.Format(format, slider.Value);
+ }
+
+ #region Preview & Selection
+
+ public void UpdatePreview()
+ {
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ var displayOpt = ppt.GetPPTButtonsDisplayOptionString();
+
+ UpdatePreviewNavBar(PreviewLS, PreviewLSBorder, displayOpt, 2, ppt.PPTLSButtonPosition, ppt.PPTLSButtonOpacity, ppt.PPTLSButtonShowPageNumber, ppt.PPTLSButtonBlackBackground);
+ UpdatePreviewNavBar(PreviewRS, PreviewRSBorder, displayOpt, 3, ppt.PPTRSButtonPosition, ppt.PPTRSButtonOpacity, ppt.PPTRSButtonShowPageNumber, ppt.PPTRSButtonBlackBackground);
+ UpdatePreviewNavBar(PreviewLB, PreviewLBBorder, displayOpt, 0, ppt.PPTLBButtonPosition, ppt.PPTLBButtonOpacity, ppt.PPTLBButtonShowPageNumber, ppt.PPTLBButtonBlackBackground);
+ UpdatePreviewNavBar(PreviewRB, PreviewRBBorder, displayOpt, 1, ppt.PPTRBButtonPosition, ppt.PPTRBButtonOpacity, ppt.PPTRBButtonShowPageNumber, ppt.PPTRBButtonBlackBackground);
+ }
+
+ private void UpdatePreviewNavBar(PPTNavBar navBar, Border border, string displayOpt, int index, int offset, double opacity, bool showPageNumber, bool blackBackground)
+ {
+ bool isEnabled = displayOpt.Length > index && displayOpt[index] == '2';
+ bool showTotal = CardShowPPTButton.IsOn && isEnabled;
+ border.Visibility = showTotal ? Visibility.Visible : Visibility.Collapsed;
+
+ if (!showTotal) return;
+
+ double scale = SettingsManager.Settings.PowerPointSettings.PPTNavBarScale;
+ navBar.LayoutTransform = new ScaleTransform(scale, scale);
+
+ navBar.SetBarOpacity(opacity);
+
+ double viewScale = (PreviewCanvas != null && PreviewCanvas.ActualWidth > 0) ? PreviewCanvas.ActualWidth / 1600.0 : 1.0;
+
+ var direction = navBar.Direction;
+ if (direction == PPTNavBar.NavDirection.LeftSide)
+ {
+ border.Margin = new Thickness(6 * viewScale, 0, 0, offset * 2 * viewScale);
+ }
+ else if (direction == PPTNavBar.NavDirection.RightSide)
+ {
+ border.Margin = new Thickness(0, 0, 6 * viewScale, offset * 2 * viewScale);
+ }
+ else if (direction == PPTNavBar.NavDirection.LeftBottom)
+ {
+ border.Margin = new Thickness((6 + offset) * viewScale, 0, 0, 6 * viewScale);
+ }
+ else if (direction == PPTNavBar.NavDirection.RightBottom)
+ {
+ border.Margin = new Thickness(0, 0, (6 + offset) * viewScale, 6 * viewScale);
+ }
+
+ navBar.PageButtonBorder.Visibility = showPageNumber ? Visibility.Visible : Visibility.Collapsed;
+ navBar.ApplyTheme(blackBackground);
+ }
+
+ private void SelectPosition(PPTNavBar.NavDirection direction)
+ {
+ _selectedDirection = direction;
+
+ string title = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => Properties.PPTStrings.Position_Left,
+ PPTNavBar.NavDirection.RightSide => Properties.PPTStrings.Position_Right,
+ PPTNavBar.NavDirection.LeftBottom => Properties.PPTStrings.Position_LeftBottom,
+ PPTNavBar.NavDirection.RightBottom => Properties.PPTStrings.Position_RightBottom,
+ _ => Properties.PPTStrings.Position_Left
+ };
+ SelectedPositionTitle.Text = title;
+ SelectedPositionTitle.Visibility = Visibility.Visible;
+
+ CardEnablePositionButton.Visibility = Visibility.Visible;
+ CardOffset.Visibility = Visibility.Visible;
+ CardOpacity.Visibility = Visibility.Visible;
+ CardShowPageNumber.Visibility = Visibility.Visible;
+ CardBlackBackground.Visibility = Visibility.Visible;
+
+ // Update card headers
+ CardEnablePositionButton.Header = string.Format(Properties.PPTStrings.EnablePositionButton, title);
+ CardOffset.Header = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => Properties.PPTStrings.LeftOffset,
+ PPTNavBar.NavDirection.RightSide => Properties.PPTStrings.RightOffset,
+ PPTNavBar.NavDirection.LeftBottom => Properties.PPTStrings.LeftBottomOffset,
+ PPTNavBar.NavDirection.RightBottom => Properties.PPTStrings.RightBottomOffset,
+ _ => Properties.PPTStrings.LeftOffset
+ };
+ CardOpacity.Header = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => Properties.PPTStrings.LeftOpacity,
+ PPTNavBar.NavDirection.RightSide => Properties.PPTStrings.RightOpacity,
+ PPTNavBar.NavDirection.LeftBottom => Properties.PPTStrings.LeftBottomOpacity,
+ PPTNavBar.NavDirection.RightBottom => Properties.PPTStrings.RightBottomOpacity,
+ _ => Properties.PPTStrings.LeftOpacity
+ };
+
+ // Adjust slider ranges for bottom buttons
+ if (direction == PPTNavBar.NavDirection.LeftBottom || direction == PPTNavBar.NavDirection.RightBottom)
+ {
+ OffsetSlider.Minimum = -100;
+ }
+ else
+ {
+ OffsetSlider.Minimum = -500;
+ }
+
+ // Load current values
+ _isLoaded = false;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ var displayOpt = ppt.GetPPTButtonsDisplayOptionString();
+ int idx = GetDisplayOptionIndex(direction);
+ CardEnablePositionButton.IsOn = displayOpt.Length > idx && displayOpt[idx] == '2';
+
+ OffsetSlider.Value = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => ppt.PPTLSButtonPosition,
+ PPTNavBar.NavDirection.RightSide => ppt.PPTRSButtonPosition,
+ PPTNavBar.NavDirection.LeftBottom => ppt.PPTLBButtonPosition,
+ PPTNavBar.NavDirection.RightBottom => ppt.PPTRBButtonPosition,
+ _ => 0
+ };
+
+ OpacitySlider.Value = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => ppt.PPTLSButtonOpacity,
+ PPTNavBar.NavDirection.RightSide => ppt.PPTRSButtonOpacity,
+ PPTNavBar.NavDirection.LeftBottom => ppt.PPTLBButtonOpacity,
+ PPTNavBar.NavDirection.RightBottom => ppt.PPTRBButtonOpacity,
+ _ => 0.5
+ };
+
+ CheckboxShowPageNumber.IsChecked = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => ppt.PPTLSButtonShowPageNumber,
+ PPTNavBar.NavDirection.RightSide => ppt.PPTRSButtonShowPageNumber,
+ PPTNavBar.NavDirection.LeftBottom => ppt.PPTLBButtonShowPageNumber,
+ PPTNavBar.NavDirection.RightBottom => ppt.PPTRBButtonShowPageNumber,
+ _ => false
+ };
+
+ CheckboxBlackBackground.IsChecked = direction switch
+ {
+ PPTNavBar.NavDirection.LeftSide => ppt.PPTLSButtonBlackBackground,
+ PPTNavBar.NavDirection.RightSide => ppt.PPTRSButtonBlackBackground,
+ PPTNavBar.NavDirection.LeftBottom => ppt.PPTLBButtonBlackBackground,
+ PPTNavBar.NavDirection.RightBottom => ppt.PPTRBButtonBlackBackground,
+ _ => false
+ };
+
+ UpdateAllSliderTexts();
+ _isLoaded = true;
+ }
+
+ private int GetDisplayOptionIndex(PPTNavBar.NavDirection dir)
+ {
+ return dir switch
+ {
+ PPTNavBar.NavDirection.LeftBottom => 0,
+ PPTNavBar.NavDirection.RightBottom => 1,
+ PPTNavBar.NavDirection.LeftSide => 2,
+ PPTNavBar.NavDirection.RightSide => 3,
+ _ => 2
+ };
+ }
+
+ private bool IsSideButton(PPTNavBar.NavDirection dir)
+ {
+ return dir == PPTNavBar.NavDirection.LeftSide || dir == PPTNavBar.NavDirection.RightSide;
+ }
+
+ private void PreviewLS_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ SelectPosition(PPTNavBar.NavDirection.LeftSide);
+ }
+
+ private void PreviewRS_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ SelectPosition(PPTNavBar.NavDirection.RightSide);
+ }
+
+ private void PreviewLB_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ SelectPosition(PPTNavBar.NavDirection.LeftBottom);
+ }
+
+ private void PreviewRB_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ SelectPosition(PPTNavBar.NavDirection.RightBottom);
+ }
+
+ private void ComboBoxPosition_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (!_isLoaded || _isSyncingPosition) return;
+ var item = ComboBoxPosition.SelectedItem as ComboBoxItem;
+ if (item?.Tag == null) return;
+ if (Enum.TryParse(item.Tag.ToString(), out var dir))
+ {
+ SelectPosition(dir);
+ }
+ }
+
+ #endregion
+
+ #region Position & Opacity Sliders
+
+ private void OffsetSlider_ValueChanged(object sender, RoutedEventArgs e)
+ {
+ UpdateSliderText(OffsetSlider, OffsetText, "{0:F0}");
+ if (!_isLoaded) return;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ int val = (int)OffsetSlider.Value;
+ switch (_selectedDirection)
+ {
+ case PPTNavBar.NavDirection.LeftSide: ppt.PPTLSButtonPosition = val; break;
+ case PPTNavBar.NavDirection.RightSide: ppt.PPTRSButtonPosition = val; break;
+ case PPTNavBar.NavDirection.LeftBottom: ppt.PPTLBButtonPosition = val; break;
+ case PPTNavBar.NavDirection.RightBottom: ppt.PPTRBButtonPosition = val; break;
+ }
+ SettingsActionHub.OnPPTButtonPositionChanged();
+ _sliderDelayAction.DebounceAction(2000, null, () => SettingsManager.SaveSettingsToFile());
+ UpdatePreview();
+ }
+
+ private void OpacitySlider_ValueChanged(object sender, RoutedEventArgs e)
+ {
+ UpdateSliderText(OpacitySlider, OpacityText, "{0:P0}");
+ if (!_isLoaded) return;
+ double roundedValue = Math.Round(OpacitySlider.Value, 1);
+ OpacitySlider.ValueChanged -= OpacitySlider_ValueChanged;
+ OpacitySlider.Value = roundedValue;
+ OpacitySlider.ValueChanged += OpacitySlider_ValueChanged;
+
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ switch (_selectedDirection)
+ {
+ case PPTNavBar.NavDirection.LeftSide: ppt.PPTLSButtonOpacity = roundedValue; break;
+ case PPTNavBar.NavDirection.RightSide: ppt.PPTRSButtonOpacity = roundedValue; break;
+ case PPTNavBar.NavDirection.LeftBottom: ppt.PPTLBButtonOpacity = roundedValue; break;
+ case PPTNavBar.NavDirection.RightBottom: ppt.PPTRBButtonOpacity = roundedValue; break;
+ }
+ SettingsManager.SaveSettingsToFile();
+ string key = _selectedDirection switch
+ {
+ PPTNavBar.NavDirection.LeftSide => "LS",
+ PPTNavBar.NavDirection.RightSide => "RS",
+ PPTNavBar.NavDirection.LeftBottom => "LB",
+ PPTNavBar.NavDirection.RightBottom => "RB",
+ _ => "LS"
+ };
+ SettingsActionHub.OnPPTButtonOpacityChanged(key, roundedValue);
+ UpdatePreview();
+ }
+
+ private void ButtonResetOffset_Click(object sender, RoutedEventArgs e)
+ {
+ OffsetSlider.Value = 0;
+ }
+
+ private void ButtonResetOpacity_Click(object sender, RoutedEventArgs e)
+ {
+ OpacitySlider.Value = 0.5;
+ }
+
+ #endregion
+
+ #region Toggle Switches & Checkboxes
+
+ private void ToggleSwitchShowPPTButton_OnToggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.ShowPPTButton = CardShowPPTButton.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnShowPPTButtonChanged(CardShowPPTButton.IsOn);
+ UpdatePreview();
+ }
+
+ private void ToggleSwitchEnablePositionButton_Toggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ var str = ppt.GetPPTButtonsDisplayOptionString();
+ char[] c = str.ToCharArray();
+ int idx = GetDisplayOptionIndex(_selectedDirection);
+ if (idx < c.Length)
+ {
+ c[idx] = CardEnablePositionButton.IsOn ? '2' : '1';
+ ppt.PPTButtonsDisplayOption = int.Parse(new string(c));
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnPPTButtonsDisplayOptionChanged();
+ UpdatePreview();
+ }
+ }
+
+ private void CheckboxShowPageNumber_Changed(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ bool val = CheckboxShowPageNumber.IsChecked == true;
+ string key = _selectedDirection switch
+ {
+ PPTNavBar.NavDirection.LeftSide => "LS",
+ PPTNavBar.NavDirection.RightSide => "RS",
+ PPTNavBar.NavDirection.LeftBottom => "LB",
+ PPTNavBar.NavDirection.RightBottom => "RB",
+ _ => "LS"
+ };
+ switch (_selectedDirection)
+ {
+ case PPTNavBar.NavDirection.LeftSide: ppt.PPTLSButtonShowPageNumber = val; break;
+ case PPTNavBar.NavDirection.RightSide: ppt.PPTRSButtonShowPageNumber = val; break;
+ case PPTNavBar.NavDirection.LeftBottom: ppt.PPTLBButtonShowPageNumber = val; break;
+ case PPTNavBar.NavDirection.RightBottom: ppt.PPTRBButtonShowPageNumber = val; break;
+ }
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnPPTButtonShowPageNumberChanged(key, val);
+ UpdatePreview();
+ }
+
+ private void CheckboxBlackBackground_Changed(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ var ppt = SettingsManager.Settings.PowerPointSettings;
+ bool val = CheckboxBlackBackground.IsChecked == true;
+ string key = _selectedDirection switch
+ {
+ PPTNavBar.NavDirection.LeftSide => "LS",
+ PPTNavBar.NavDirection.RightSide => "RS",
+ PPTNavBar.NavDirection.LeftBottom => "LB",
+ PPTNavBar.NavDirection.RightBottom => "RB",
+ _ => "LS"
+ };
+ switch (_selectedDirection)
+ {
+ case PPTNavBar.NavDirection.LeftSide: ppt.PPTLSButtonBlackBackground = val; break;
+ case PPTNavBar.NavDirection.RightSide: ppt.PPTRSButtonBlackBackground = val; break;
+ case PPTNavBar.NavDirection.LeftBottom: ppt.PPTLBButtonBlackBackground = val; break;
+ case PPTNavBar.NavDirection.RightBottom: ppt.PPTRBButtonBlackBackground = val; break;
+ }
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnPPTButtonBlackBackgroundChanged(key, val);
+ UpdatePreview();
+ }
+
+ private void PPTNavBarScaleValueSlider_ValueChanged(object sender, RoutedEventArgs e)
+ {
+ UpdateSliderText(PPTNavBarScaleValueSlider, PPTNavBarScaleText, "{0:F2}");
+ if (!_isLoaded) return;
+ double roundedValue = Math.Round(PPTNavBarScaleValueSlider.Value, 2);
+ PPTNavBarScaleValueSlider.ValueChanged -= PPTNavBarScaleValueSlider_ValueChanged;
+ PPTNavBarScaleValueSlider.Value = roundedValue;
+ PPTNavBarScaleValueSlider.ValueChanged += PPTNavBarScaleValueSlider_ValueChanged;
+ SettingsManager.Settings.PowerPointSettings.PPTNavBarScale = roundedValue;
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnPPTNavBarScaleChanged(roundedValue);
+ UpdatePreview();
+ }
+
+ private void ToggleSwitchEnablePPTButtonPageClickable_OnToggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.EnablePPTButtonPageClickable = CardEnablePPTButtonPageClickable.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ }
+
+ private void ToggleSwitchEnablePPTButtonEnhancedPreview_OnToggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.EnablePPTButtonEnhancedPreview = CardEnablePPTButtonEnhancedPreview.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ }
+
+ private void ToggleSwitchEnablePPTButtonLongPressPageTurn_OnToggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.EnablePPTButtonLongPressPageTurn = CardEnablePPTButtonLongPressPageTurn.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ }
+
+ #endregion
+ }
+}
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml
index 14dffc2b..a211aeab 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml
+++ b/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml
@@ -3,7 +3,6 @@
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:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
@@ -13,7 +12,7 @@
Title="{x:Static props:NavStrings.Nav_PPT_Settings}">
-
+
4
@@ -25,361 +24,201 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml.cs b/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml.cs
index edafd152..03e596b3 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml.cs
+++ b/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml.cs
@@ -11,7 +11,6 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
public partial class PowerPointPage : Page
{
private bool _isLoaded = false;
- private DelayAction _sliderDelayAction = new DelayAction();
public PowerPointPage()
{
@@ -24,29 +23,9 @@ private void PowerPointPage_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
_isLoaded = true;
- UpdateAllSliderTexts();
SliderTouchHelper.AddTouchSupportToAllSliders(this);
}
- private void UpdateAllSliderTexts()
- {
- UpdateSliderText(PPTButtonLeftPositionValueSlider, PPTButtonLeftPositionText, "{0:F0}");
- UpdateSliderText(PPTButtonRightPositionValueSlider, PPTButtonRightPositionText, "{0:F0}");
- UpdateSliderText(PPTButtonLBPositionValueSlider, PPTButtonLBPositionText, "{0:F0}");
- UpdateSliderText(PPTButtonRBPositionValueSlider, PPTButtonRBPositionText, "{0:F0}");
- UpdateSliderText(PPTLSButtonOpacityValueSlider, PPTLSButtonOpacityText, "{0:P0}");
- UpdateSliderText(PPTRSButtonOpacityValueSlider, PPTRSButtonOpacityText, "{0:P0}");
- UpdateSliderText(PPTLBButtonOpacityValueSlider, PPTLBButtonOpacityText, "{0:P0}");
- UpdateSliderText(PPTRBButtonOpacityValueSlider, PPTRBButtonOpacityText, "{0:P0}");
- UpdateSliderText(PPTNavBarScaleValueSlider, PPTNavBarScaleText, "{0:F2}");
- }
-
- private void UpdateSliderText(Slider slider, TextBlock textBlock, string format)
- {
- if (slider == null || textBlock == null) return;
- textBlock.Text = string.Format(format, slider.Value);
- }
-
private void PowerPointPage_Unloaded(object sender, RoutedEventArgs e)
{
_isLoaded = false;
@@ -65,39 +44,6 @@ private void LoadSettings()
CardEnableWppProcessKill.IsOn = ppt.EnableWppProcessKill;
UpdatePPTArchitectureDependentCards();
- CardShowPPTButton.IsOn = ppt.ShowPPTButton;
- var displayOpt = ppt.PPTButtonsDisplayOption.ToString();
- CheckboxEnableLBPPTButton.IsChecked = displayOpt.Length > 0 && displayOpt[0] == '2';
- CheckboxEnableRBPPTButton.IsChecked = displayOpt.Length > 1 && displayOpt[1] == '2';
- CheckboxEnableLSPPTButton.IsChecked = displayOpt.Length > 2 && displayOpt[2] == '2';
- CheckboxEnableRSPPTButton.IsChecked = displayOpt.Length > 3 && displayOpt[3] == '2';
-
- PPTButtonLeftPositionValueSlider.Value = ppt.PPTLSButtonPosition;
- PPTButtonRightPositionValueSlider.Value = ppt.PPTRSButtonPosition;
- PPTButtonLBPositionValueSlider.Value = ppt.PPTLBButtonPosition;
- PPTButtonRBPositionValueSlider.Value = ppt.PPTRBButtonPosition;
-
- PPTLSButtonOpacityValueSlider.Value = ppt.PPTLSButtonOpacity;
- PPTRSButtonOpacityValueSlider.Value = ppt.PPTRSButtonOpacity;
- PPTLBButtonOpacityValueSlider.Value = ppt.PPTLBButtonOpacity;
- PPTRBButtonOpacityValueSlider.Value = ppt.PPTRBButtonOpacity;
-
- PPTNavBarScaleValueSlider.Value = ppt.PPTNavBarScale;
-
- var sOpt = ppt.PPTSButtonsOption.ToString();
- CheckboxSPPTDisplayPage.IsChecked = sOpt.Length > 0 && sOpt[0] == '2';
- CheckboxSPPTHalfOpacity.IsChecked = sOpt.Length > 1 && sOpt[1] == '2';
- CheckboxSPPTBlackBackground.IsChecked = sOpt.Length > 2 && sOpt[2] == '2';
-
- var bOpt = ppt.PPTBButtonsOption.ToString();
- CheckboxBPPTDisplayPage.IsChecked = bOpt.Length > 0 && bOpt[0] == '2';
- CheckboxBPPTHalfOpacity.IsChecked = bOpt.Length > 1 && bOpt[1] == '2';
- CheckboxBPPTBlackBackground.IsChecked = bOpt.Length > 2 && bOpt[2] == '2';
-
- CardEnablePPTButtonPageClickable.IsOn = ppt.EnablePPTButtonPageClickable;
- CardEnablePPTButtonEnhancedPreview.IsOn = ppt.EnablePPTButtonEnhancedPreview;
- CardEnablePPTButtonLongPressPageTurn.IsOn = ppt.EnablePPTButtonLongPressPageTurn;
-
CardShowCanvasAtNewSlideShow.IsOn = ppt.IsShowCanvasAtNewSlideShow;
CardEnableMediaPassthrough.IsOn = ppt.EnableMediaPassthrough;
@@ -105,6 +51,8 @@ private void LoadSettings()
CardEnableFingerGestureSlideShowControl.IsOn = ppt.IsEnableFingerGestureSlideShowControl;
CardEnablePPTTimeCapsule.IsOn = ppt.EnablePPTTimeCapsule;
ComboBoxPPTTimeCapsulePosition.SelectedIndex = ppt.PPTTimeCapsulePosition;
+ SliderPPTTimeCapsuleOpacity.Value = ppt.PPTTimeCapsuleOpacity;
+ SliderPPTTimeCapsuleScale.Value = ppt.PPTTimeCapsuleScale;
CardShowPPTSidebarByDefault.IsOn = ppt.ShowPPTSidebarByDefault;
CardShowPPTModePrompt.IsOn = ppt.ShowPPTModePrompt;
@@ -119,6 +67,16 @@ private void LoadSettings()
_isLoaded = true;
}
+ #region Navigation
+
+ private void GoToFlipButtonSettingsButton_Click(object sender, RoutedEventArgs e)
+ {
+ var settingsWindow = Window.GetWindow(this) as SettingsViews.SettingsWindow;
+ settingsWindow?.NavigateToPage("PPTFlipButtonSettingsPage");
+ }
+
+ #endregion
+
#region PPT Basic
private void UpdatePPTArchitectureDependentCards()
@@ -223,305 +181,6 @@ private void ToggleSwitchEnableWppProcessKill_Toggled(object sender, RoutedEvent
#endregion
- #region PPT Flip Buttons
-
- private void ToggleSwitchShowPPTButton_OnToggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.ShowPPTButton = CardShowPPTButton.IsOn;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnShowPPTButtonChanged(CardShowPPTButton.IsOn);
- }
-
- private void ToggleSwitchShowPPTSidebarByDefault_Toggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.ShowPPTSidebarByDefault = CardShowPPTSidebarByDefault.IsOn;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnShowPPTSidebarByDefaultChanged();
- }
-
- private void ToggleSwitchShowPPTModePrompt_Toggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.ShowPPTModePrompt = CardShowPPTModePrompt.IsOn;
- SettingsManager.SaveSettingsToFile();
- }
-
- private void ToggleSwitchEnablePPTButtonPageClickable_OnToggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.EnablePPTButtonPageClickable = CardEnablePPTButtonPageClickable.IsOn;
- SettingsManager.SaveSettingsToFile();
- }
-
- private void ToggleSwitchEnablePPTButtonEnhancedPreview_OnToggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.EnablePPTButtonEnhancedPreview = CardEnablePPTButtonEnhancedPreview.IsOn;
- SettingsManager.SaveSettingsToFile();
- }
-
- private void ToggleSwitchEnablePPTButtonLongPressPageTurn_OnToggled(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.EnablePPTButtonLongPressPageTurn = CardEnablePPTButtonLongPressPageTurn.IsOn;
- SettingsManager.SaveSettingsToFile();
- }
-
- #endregion
-
- #region PPT Button Position & Opacity Sliders
-
- private void PPTButtonLeftPositionValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTButtonLeftPositionValueSlider, PPTButtonLeftPositionText, "{0:F0}");
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.PPTLSButtonPosition = (int)PPTButtonLeftPositionValueSlider.Value;
- SettingsActionHub.OnPPTButtonPositionChanged();
- _sliderDelayAction.DebounceAction(2000, null, () => SettingsManager.SaveSettingsToFile());
- }
-
- private void PPTButtonRightPositionValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTButtonRightPositionValueSlider, PPTButtonRightPositionText, "{0:F0}");
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.PPTRSButtonPosition = (int)PPTButtonRightPositionValueSlider.Value;
- SettingsActionHub.OnPPTButtonPositionChanged();
- _sliderDelayAction.DebounceAction(2000, null, () => SettingsManager.SaveSettingsToFile());
- }
-
- private void PPTButtonLBPositionValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTButtonLBPositionValueSlider, PPTButtonLBPositionText, "{0:F0}");
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.PPTLBButtonPosition = (int)PPTButtonLBPositionValueSlider.Value;
- SettingsActionHub.OnPPTButtonPositionChanged();
- _sliderDelayAction.DebounceAction(2000, null, () => SettingsManager.SaveSettingsToFile());
- }
-
- private void PPTButtonRBPositionValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTButtonRBPositionValueSlider, PPTButtonRBPositionText, "{0:F0}");
- if (!_isLoaded) return;
- SettingsManager.Settings.PowerPointSettings.PPTRBButtonPosition = (int)PPTButtonRBPositionValueSlider.Value;
- SettingsActionHub.OnPPTButtonPositionChanged();
- _sliderDelayAction.DebounceAction(2000, null, () => SettingsManager.SaveSettingsToFile());
- }
-
- private void PPTLSButtonOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTLSButtonOpacityValueSlider, PPTLSButtonOpacityText, "{0:P0}");
- if (!_isLoaded) return;
- double roundedValue = Math.Round(PPTLSButtonOpacityValueSlider.Value, 1);
- PPTLSButtonOpacityValueSlider.ValueChanged -= PPTLSButtonOpacityValueSlider_ValueChanged;
- PPTLSButtonOpacityValueSlider.Value = roundedValue;
- PPTLSButtonOpacityValueSlider.ValueChanged += PPTLSButtonOpacityValueSlider_ValueChanged;
- SettingsManager.Settings.PowerPointSettings.PPTLSButtonOpacity = roundedValue;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonOpacityChanged("LS", roundedValue);
- }
-
- private void PPTRSButtonOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTRSButtonOpacityValueSlider, PPTRSButtonOpacityText, "{0:P0}");
- if (!_isLoaded) return;
- double roundedValue = Math.Round(PPTRSButtonOpacityValueSlider.Value, 1);
- PPTRSButtonOpacityValueSlider.ValueChanged -= PPTRSButtonOpacityValueSlider_ValueChanged;
- PPTRSButtonOpacityValueSlider.Value = roundedValue;
- PPTRSButtonOpacityValueSlider.ValueChanged += PPTRSButtonOpacityValueSlider_ValueChanged;
- SettingsManager.Settings.PowerPointSettings.PPTRSButtonOpacity = roundedValue;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonOpacityChanged("RS", roundedValue);
- }
-
- private void PPTLBButtonOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTLBButtonOpacityValueSlider, PPTLBButtonOpacityText, "{0:P0}");
- if (!_isLoaded) return;
- double roundedValue = Math.Round(PPTLBButtonOpacityValueSlider.Value, 1);
- PPTLBButtonOpacityValueSlider.ValueChanged -= PPTLBButtonOpacityValueSlider_ValueChanged;
- PPTLBButtonOpacityValueSlider.Value = roundedValue;
- PPTLBButtonOpacityValueSlider.ValueChanged += PPTLBButtonOpacityValueSlider_ValueChanged;
- SettingsManager.Settings.PowerPointSettings.PPTLBButtonOpacity = roundedValue;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonOpacityChanged("LB", roundedValue);
- }
-
- private void PPTRBButtonOpacityValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTRBButtonOpacityValueSlider, PPTRBButtonOpacityText, "{0:P0}");
- if (!_isLoaded) return;
- double roundedValue = Math.Round(PPTRBButtonOpacityValueSlider.Value, 1);
- PPTRBButtonOpacityValueSlider.ValueChanged -= PPTRBButtonOpacityValueSlider_ValueChanged;
- PPTRBButtonOpacityValueSlider.Value = roundedValue;
- PPTRBButtonOpacityValueSlider.ValueChanged += PPTRBButtonOpacityValueSlider_ValueChanged;
- SettingsManager.Settings.PowerPointSettings.PPTRBButtonOpacity = roundedValue;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonOpacityChanged("RB", roundedValue);
- }
-
- private void PPTNavBarScaleValueSlider_ValueChanged(object sender, RoutedEventArgs e)
- {
- UpdateSliderText(PPTNavBarScaleValueSlider, PPTNavBarScaleText, "{0:F2}");
- if (!_isLoaded) return;
- double roundedValue = Math.Round(PPTNavBarScaleValueSlider.Value, 2);
- PPTNavBarScaleValueSlider.ValueChanged -= PPTNavBarScaleValueSlider_ValueChanged;
- PPTNavBarScaleValueSlider.Value = roundedValue;
- PPTNavBarScaleValueSlider.ValueChanged += PPTNavBarScaleValueSlider_ValueChanged;
- SettingsManager.Settings.PowerPointSettings.PPTNavBarScale = roundedValue;
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTNavBarScaleChanged(roundedValue);
- }
-
- #endregion
-
- #region PPT Button Display Checkboxes
-
- private void CheckboxEnableLBPPTButton_IsCheckChanged(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
- char[] c = str.ToCharArray();
- c[0] = CheckboxEnableLBPPTButton.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonsDisplayOptionChanged();
- }
-
- private void CheckboxEnableRBPPTButton_IsCheckChanged(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
- char[] c = str.ToCharArray();
- c[1] = CheckboxEnableRBPPTButton.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonsDisplayOptionChanged();
- }
-
- private void CheckboxEnableLSPPTButton_IsCheckChanged(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
- char[] c = str.ToCharArray();
- c[2] = CheckboxEnableLSPPTButton.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonsDisplayOptionChanged();
- }
-
- private void CheckboxEnableRSPPTButton_IsCheckChanged(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption.ToString();
- char[] c = str.ToCharArray();
- c[3] = CheckboxEnableRSPPTButton.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTButtonsDisplayOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTButtonsDisplayOptionChanged();
- }
-
- private void CheckboxSPPTDisplayPage_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTSButtonsOption.ToString();
- char[] c = str.ToCharArray();
- c[0] = CheckboxSPPTDisplayPage.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTSButtonsOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTSButtonsOptionChanged();
- }
-
- private void CheckboxSPPTHalfOpacity_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var ppt = SettingsManager.Settings.PowerPointSettings;
- var str = ppt.PPTSButtonsOption.ToString();
- char[] c = str.ToCharArray();
- bool isHalf = CheckboxSPPTHalfOpacity.IsChecked == true;
- c[1] = isHalf ? '2' : '1';
- ppt.PPTSButtonsOption = int.Parse(new string(c));
- if (isHalf)
- {
- if (ppt.PPTLSButtonOpacity == 1.0) ppt.PPTLSButtonOpacity = 0.5;
- if (ppt.PPTRSButtonOpacity == 1.0) ppt.PPTRSButtonOpacity = 0.5;
- PPTLSButtonOpacityValueSlider.Value = ppt.PPTLSButtonOpacity;
- PPTRSButtonOpacityValueSlider.Value = ppt.PPTRSButtonOpacity;
- }
- else
- {
- if (ppt.PPTLSButtonOpacity == 0.5) ppt.PPTLSButtonOpacity = 1.0;
- if (ppt.PPTRSButtonOpacity == 0.5) ppt.PPTRSButtonOpacity = 1.0;
- PPTLSButtonOpacityValueSlider.Value = ppt.PPTLSButtonOpacity;
- PPTRSButtonOpacityValueSlider.Value = ppt.PPTRSButtonOpacity;
- }
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTSButtonsOptionWithOpacityChanged();
- }
-
- private void CheckboxSPPTBlackBackground_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTSButtonsOption.ToString();
- char[] c = str.ToCharArray();
- c[2] = CheckboxSPPTBlackBackground.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTSButtonsOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTSButtonsOptionChanged();
- }
-
- private void CheckboxBPPTDisplayPage_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTBButtonsOption.ToString();
- char[] c = str.ToCharArray();
- c[0] = CheckboxBPPTDisplayPage.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTBButtonsOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTBButtonsOptionChanged();
- }
-
- private void CheckboxBPPTHalfOpacity_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var ppt = SettingsManager.Settings.PowerPointSettings;
- var str = ppt.PPTBButtonsOption.ToString();
- char[] c = str.ToCharArray();
- bool isHalf = CheckboxBPPTHalfOpacity.IsChecked == true;
- c[1] = isHalf ? '2' : '1';
- ppt.PPTBButtonsOption = int.Parse(new string(c));
- if (isHalf)
- {
- if (ppt.PPTLBButtonOpacity == 1.0) ppt.PPTLBButtonOpacity = 0.5;
- if (ppt.PPTRBButtonOpacity == 1.0) ppt.PPTRBButtonOpacity = 0.5;
- PPTLBButtonOpacityValueSlider.Value = ppt.PPTLBButtonOpacity;
- PPTRBButtonOpacityValueSlider.Value = ppt.PPTRBButtonOpacity;
- }
- else
- {
- if (ppt.PPTLBButtonOpacity == 0.5) ppt.PPTLBButtonOpacity = 1.0;
- if (ppt.PPTRBButtonOpacity == 0.5) ppt.PPTRBButtonOpacity = 1.0;
- PPTLBButtonOpacityValueSlider.Value = ppt.PPTLBButtonOpacity;
- PPTRBButtonOpacityValueSlider.Value = ppt.PPTRBButtonOpacity;
- }
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTBButtonsOptionWithOpacityChanged();
- }
-
- private void CheckboxBPPTBlackBackground_IsCheckChange(object sender, RoutedEventArgs e)
- {
- if (!_isLoaded) return;
- var str = SettingsManager.Settings.PowerPointSettings.PPTBButtonsOption.ToString();
- char[] c = str.ToCharArray();
- c[2] = CheckboxBPPTBlackBackground.IsChecked == true ? '2' : '1';
- SettingsManager.Settings.PowerPointSettings.PPTBButtonsOption = int.Parse(new string(c));
- SettingsManager.SaveSettingsToFile();
- SettingsActionHub.OnPPTBButtonsOptionChanged();
- }
-
- #endregion
-
#region PPT SlideShow Entry & Gesture
private void ToggleSwitchShowCanvasAtNewSlideShow_Toggled(object sender, RoutedEventArgs e)
@@ -602,6 +261,21 @@ private void ButtonResetPPTTimeCapsulePosition_Click(object sender, RoutedEventA
SettingsActionHub.OnResetPPTTimeCapsulePosition();
}
+ private void ToggleSwitchShowPPTSidebarByDefault_Toggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.ShowPPTSidebarByDefault = CardShowPPTSidebarByDefault.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ SettingsActionHub.OnShowPPTSidebarByDefaultChanged();
+ }
+
+ private void ToggleSwitchShowPPTModePrompt_Toggled(object sender, RoutedEventArgs e)
+ {
+ if (!_isLoaded) return;
+ SettingsManager.Settings.PowerPointSettings.ShowPPTModePrompt = CardShowPPTModePrompt.IsOn;
+ SettingsManager.SaveSettingsToFile();
+ }
+
#endregion
#region PPT Auto Save & Notifications
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/ToolbarMenuPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/ToolbarMenuPage.xaml
index 3450d90f..82d42e1a 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/ToolbarMenuPage.xaml
+++ b/Ink Canvas/Windows/SettingsViews/Pages/ToolbarMenuPage.xaml
@@ -169,6 +169,6 @@
+ HorizontalAlignment="Left" Margin="0,12,0,16"/>
diff --git a/Ink Canvas/Windows/SettingsViews/Pages/ToolbarPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/ToolbarPage.xaml
index 14e523c3..8177586b 100644
--- a/Ink Canvas/Windows/SettingsViews/Pages/ToolbarPage.xaml
+++ b/Ink Canvas/Windows/SettingsViews/Pages/ToolbarPage.xaml
@@ -133,28 +133,28 @@
FontSize="14" FontWeight="SemiBold" Margin="0,0,0,4"/>
-
-
+
-
-
-
-
-
+
@@ -548,6 +548,6 @@
+ HorizontalAlignment="Left" Margin="0,12,0,16"/>
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
index fbe8590c..8b908bee 100644
--- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
+++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
@@ -42,6 +42,7 @@ public partial class SettingsWindow : Window
{ "CloudStoragePage", typeof(CloudStoragePage) },
{ "AutomationWorkflowPage", typeof(AutomationWorkflowPage) },
{ "PowerPointPage", typeof(PowerPointPage) },
+ { "PPTFlipButtonSettingsPage", typeof(PPTFlipButtonSettingsPage) },
{ "RandomDrawPage", typeof(RandomDrawPage) },
{ "CanvasPage", typeof(CanvasPage) },
{ "InkRecognitionPage", typeof(InkRecognitionPage) },
@@ -103,6 +104,7 @@ public SettingsWindow()
{ "CloudStoragePage", typeof(CloudStoragePage) },
{ "AutomationWorkflowPage", typeof(AutomationWorkflowPage) },
{ "PowerPointPage", typeof(PowerPointPage) },
+ { "PPTFlipButtonSettingsPage", typeof(PPTFlipButtonSettingsPage) },
{ "RandomDrawPage", typeof(RandomDrawPage) },
{ "CanvasPage", typeof(CanvasPage) },
{ "InkRecognitionPage", typeof(InkRecognitionPage) },