This commit is contained in:
PrefacedCorg
2026-04-23 23:53:52 +08:00
parent 532aa03c56
commit f05062f902
6 changed files with 8 additions and 83 deletions
+1 -10
View File
@@ -626,16 +626,7 @@
</ikw:SimpleStackPanel>
</ikw:SimpleStackPanel>
</Border>
<GroupBox Name="GroupBoxModeSettings">
<GroupBox.Header>
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Settings_Mode}" FontWeight="Bold" Foreground="#fafafa"
FontSize="26" />
</GroupBox.Header>
<ikw:SimpleStackPanel Spacing="6" Margin="0,10,0,0">
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10" Foreground="#fafafa" Text="{i18n:I18n Key=Settings_ModeDesc}"/>
<controls:LabeledToggleSwitch x:Name="ToggleSwitchMode" Label="{i18n:I18n Key=Mode_Normal}" OnContent="{i18n:I18n Key=Mode_PPTOnly}" OffContent="{i18n:I18n Key=Mode_PPTOnly}" IsOn="False" Toggled="ToggleSwitchMode_Toggled"/>
</ikw:SimpleStackPanel>
</GroupBox>
<GroupBox Name="GroupBoxSettings">
<GroupBox.Header>
-35
View File
@@ -3755,42 +3755,7 @@ namespace Ink_Canvas
#region
/// <summary>
/// 模式切换开关事件处理
/// </summary>
private void ToggleSwitchMode_Toggled(object sender, RoutedEventArgs e)
{
try
{
var toggle = sender as ToggleSwitch;
if (toggle != null)
{
Settings.ModeSettings.IsPPTOnlyMode = toggle.IsOn;
// 保存设置到文件
SaveSettingsToFile();
// 如果切换到仅PPT模式,立即隐藏主窗口
if (Settings.ModeSettings.IsPPTOnlyMode)
{
Hide();
LogHelper.WriteLogToFile("已切换到仅PPT模式,主窗口已隐藏", LogHelper.LogType.Event);
EnsurePptOnlyVisibilityProbeTimer();
}
else
{
StopPptOnlyVisibilityProbeTimer();
// 如果切换到正常模式,显示主窗口
Show();
LogHelper.WriteLogToFile("已切换到正常模式,主窗口已显示", LogHelper.LogType.Event);
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"切换模式时出错: {ex.Message}", LogHelper.LogType.Error);
}
}
/// <summary>
/// 检查是否应该显示主窗口(基于PPT模式和PPT放映状态)
-11
View File
@@ -1,11 +0,0 @@
using Ink_Canvas.Windows.SettingsViews.Helpers;
namespace Ink_Canvas
{
public partial class MainWindow
{
public static bool StartAutomaticallyCreate(string exeName) => AutoStartHelper.StartAutomaticallyCreate(exeName);
public static bool StartAutomaticallyDel(string exeName) => AutoStartHelper.StartAutomaticallyDel(exeName);
}
}
-12
View File
@@ -3063,18 +3063,6 @@ namespace Ink_Canvas
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}
#endregion
#region Ink To Shape
#endregion
#region Advanced
+7 -14
View File
@@ -1015,22 +1015,15 @@ namespace Ink_Canvas
}
// ModeSettings
if (Settings.ModeSettings != null)
{
ToggleSwitchMode.IsOn = Settings.ModeSettings.IsPPTOnlyMode;
// 根据加载的配置状态执行相应的窗口显示/隐藏逻辑
if (isStartup && Settings.ModeSettings.IsPPTOnlyMode)
{
// 启动时如果是仅PPT模式,隐藏主窗口
Hide();
LogHelper.WriteLogToFile("启动时检测到仅PPT模式,主窗口已隐藏", LogHelper.LogType.Event);
}
}
else
if (Settings.ModeSettings == null)
{
Settings.ModeSettings = new ModeSettings();
ToggleSwitchMode.IsOn = false;
}
if (isStartup && Settings.ModeSettings.IsPPTOnlyMode)
{
Hide();
LogHelper.WriteLogToFile("启动时检测到仅PPT模式,主窗口已隐藏", LogHelper.LogType.Event);
}
// Automation
@@ -10,7 +10,6 @@
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
IsOn="{Binding IsOn, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay}"
FontWeight="Bold"
Toggled="ToggleSwitch_Toggled"/>
</ui:SettingsCard>
</UserControl>