1145141919810
代码清理
This commit is contained in:
@@ -1029,41 +1029,41 @@ namespace Ink_Canvas
|
||||
// 获取当前屏幕的实际尺寸(考虑DPI缩放)
|
||||
var actualScreenWidth = SystemParameters.PrimaryScreenWidth;
|
||||
var actualScreenHeight = SystemParameters.PrimaryScreenHeight;
|
||||
|
||||
|
||||
// 预览区域固定尺寸
|
||||
const double previewWidth = 324.0;
|
||||
const double previewHeight = 182.0;
|
||||
|
||||
|
||||
// 计算缩放比例(预览区域与实际屏幕的比例)
|
||||
double scaleX = previewWidth / actualScreenWidth;
|
||||
double scaleY = previewHeight / actualScreenHeight;
|
||||
|
||||
|
||||
// 获取按钮位置设置
|
||||
double rsPosition = Settings.PowerPointSettings.PPTRSButtonPosition;
|
||||
double lsPosition = Settings.PowerPointSettings.PPTLSButtonPosition;
|
||||
double lbPosition = Settings.PowerPointSettings.PPTLBButtonPosition;
|
||||
double rbPosition = Settings.PowerPointSettings.PPTRBButtonPosition;
|
||||
|
||||
|
||||
bool showSidePageButton = sopt.Length >= 1 && sopt[0] == '2';
|
||||
bool showBottomPageButton = bopt.Length >= 1 && bopt[0] == '2';
|
||||
|
||||
|
||||
// 页码按钮的实际尺寸
|
||||
const double pageButtonWidth = 50.0;
|
||||
const double pageButtonHeight = 50.0;
|
||||
|
||||
const double pageButtonWidth = 50.0;
|
||||
const double pageButtonHeight = 50.0;
|
||||
|
||||
// 计算侧边按钮位置(Y轴偏移)
|
||||
double sideOffsetY = showSidePageButton ? pageButtonHeight * scaleY : 0;
|
||||
PPTBtnPreviewRSTransform.Y = -(rsPosition * scaleY) - sideOffsetY;
|
||||
PPTBtnPreviewLSTransform.Y = -(lsPosition * scaleY) - sideOffsetY;
|
||||
|
||||
|
||||
// 计算底部按钮位置(X轴偏移)
|
||||
const double bottomMarginOffset = 6.0;
|
||||
const double bottomMarginOffset = 6.0;
|
||||
double scaledMarginOffset = bottomMarginOffset * scaleX;
|
||||
|
||||
|
||||
double bottomOffsetX = showBottomPageButton ? pageButtonWidth * scaleX : 0;
|
||||
PPTBtnPreviewLBTransform.X = scaledMarginOffset + (lbPosition * scaleX) + bottomOffsetX;
|
||||
PPTBtnPreviewRBTransform.X = -(scaledMarginOffset + (rbPosition * scaleX) + bottomOffsetX);
|
||||
|
||||
|
||||
// 计算工具栏尺寸
|
||||
var dpiScaleX = 1.0;
|
||||
var dpiScaleY = 1.0;
|
||||
@@ -1082,17 +1082,17 @@ namespace Ink_Canvas
|
||||
dpiScaleX = 1.0;
|
||||
dpiScaleY = 1.0;
|
||||
}
|
||||
|
||||
|
||||
// 计算工具栏的实际尺寸
|
||||
const double baseToolbarHeight = 24.0;
|
||||
|
||||
const double baseToolbarHeight = 24.0;
|
||||
|
||||
double actualToolbarHeight = baseToolbarHeight * dpiScaleY;
|
||||
double scaledToolbarHeight = actualToolbarHeight * scaleY;
|
||||
double scaledToolbarWidth = previewWidth;
|
||||
|
||||
|
||||
// 设置工具栏尺寸
|
||||
PPTBtnPreviewToolbar.Height = scaledToolbarHeight;
|
||||
PPTBtnPreviewToolbar.Width = scaledToolbarWidth;
|
||||
PPTBtnPreviewToolbar.Width = scaledToolbarWidth;
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||
@@ -1495,18 +1495,18 @@ namespace Ink_Canvas
|
||||
private void ToggleSwitchAutoFoldInPPTSlideShow_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
|
||||
// 记录设置变更前的状态
|
||||
bool previousState = Settings.Automation.IsAutoFoldInPPTSlideShow;
|
||||
Settings.Automation.IsAutoFoldInPPTSlideShow = ToggleSwitchAutoFoldInPPTSlideShow.IsOn;
|
||||
|
||||
|
||||
// 如果设置状态发生变化,重置PPT相关状态变量
|
||||
if (previousState != Settings.Automation.IsAutoFoldInPPTSlideShow)
|
||||
{
|
||||
ResetPPTStateVariables();
|
||||
LogHelper.WriteLogToFile($"PPT自动收纳设置已变更: {Settings.Automation.IsAutoFoldInPPTSlideShow}, 已重置相关状态变量", LogHelper.LogType.Trace);
|
||||
}
|
||||
|
||||
|
||||
if (Settings.Automation.IsAutoFoldInPPTSlideShow)
|
||||
{
|
||||
SettingsPPTInkingAndAutoFoldExplictBorder.Visibility = Visibility.Visible;
|
||||
@@ -1887,7 +1887,7 @@ namespace Ink_Canvas
|
||||
private void ToggleSwitchEnableTwoFingerZoom_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
|
||||
// 如果多指书写模式启用,强制禁用双指手势
|
||||
if (ToggleSwitchEnableMultiTouchMode.IsOn)
|
||||
{
|
||||
@@ -1898,7 +1898,7 @@ namespace Ink_Canvas
|
||||
SaveSettingsToFile();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sender == ToggleSwitchEnableTwoFingerZoom)
|
||||
BoardToggleSwitchEnableTwoFingerZoom.IsOn = ToggleSwitchEnableTwoFingerZoom.IsOn;
|
||||
else
|
||||
@@ -1978,7 +1978,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
Settings.Gesture.IsEnableMultiTouchMode = ToggleSwitchEnableMultiTouchMode.IsOn;
|
||||
|
||||
|
||||
// 如果启用多指书写模式,强制禁用所有双指手势
|
||||
if (ToggleSwitchEnableMultiTouchMode.IsOn)
|
||||
{
|
||||
@@ -2003,7 +2003,7 @@ namespace Ink_Canvas
|
||||
if (BoardToggleSwitchEnableTwoFingerRotation != null)
|
||||
BoardToggleSwitchEnableTwoFingerRotation.IsOn = false;
|
||||
}
|
||||
|
||||
|
||||
CheckEnableTwoFingerGestureBtnColorPrompt();
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
@@ -2011,7 +2011,7 @@ namespace Ink_Canvas
|
||||
private void ToggleSwitchEnableTwoFingerTranslate_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
|
||||
// 如果多指书写模式启用,强制禁用双指手势
|
||||
if (ToggleSwitchEnableMultiTouchMode.IsOn)
|
||||
{
|
||||
@@ -2022,7 +2022,7 @@ namespace Ink_Canvas
|
||||
SaveSettingsToFile();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sender == ToggleSwitchEnableTwoFingerTranslate)
|
||||
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = ToggleSwitchEnableTwoFingerTranslate.IsOn;
|
||||
else
|
||||
@@ -3074,7 +3074,7 @@ namespace Ink_Canvas
|
||||
{
|
||||
Directory.CreateDirectory(configsDir);
|
||||
}
|
||||
|
||||
|
||||
File.WriteAllText(App.RootPath + settingsFileName, text);
|
||||
}
|
||||
catch { }
|
||||
|
||||
Reference in New Issue
Block a user