improve:安全面板

This commit is contained in:
2026-03-21 16:30:55 +08:00
parent e8f824a046
commit b2e0e7b9e2
6 changed files with 65 additions and 5 deletions
@@ -116,6 +116,20 @@
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="修改/清空点名名单需要密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="在修改名单或清空名单前进行密码验证" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRequirePasswordOnModifyOrClearNameList" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="RequirePasswordOnModifyOrClearNameList" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
@@ -144,4 +158,3 @@
</StackPanel>
</ScrollViewer>
</local:SettingsPanelBase>
@@ -35,6 +35,7 @@ namespace Ink_Canvas.Windows.SettingsViews
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnExit"), sec.RequirePasswordOnExit);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnEnterSettings"), sec.RequirePasswordOnEnterSettings);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnResetConfig"), sec.RequirePasswordOnResetConfig);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnModifyOrClearNameList"), sec.RequirePasswordOnModifyOrClearNameList);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableProcessProtection"), sec.EnableProcessProtection);
UpdatePasswordUiState();
@@ -65,9 +66,11 @@ namespace Ink_Canvas.Windows.SettingsViews
var t1 = FindToggleSwitch("ToggleSwitchRequirePasswordOnExit");
var t2 = FindToggleSwitch("ToggleSwitchRequirePasswordOnEnterSettings");
var t3 = FindToggleSwitch("ToggleSwitchRequirePasswordOnResetConfig");
var t4 = FindToggleSwitch("ToggleSwitchRequirePasswordOnModifyOrClearNameList");
if (t1 != null) t1.IsEnabled = usageEnabled;
if (t2 != null) t2.IsEnabled = usageEnabled;
if (t3 != null) t3.IsEnabled = usageEnabled;
if (t4 != null) t4.IsEnabled = usageEnabled;
}
/// <summary>
@@ -143,6 +146,10 @@ namespace Ink_Canvas.Windows.SettingsViews
sec.RequirePasswordOnResetConfig = newState;
MainWindow.SaveSettingsToFile();
break;
case "RequirePasswordOnModifyOrClearNameList":
sec.RequirePasswordOnModifyOrClearNameList = newState;
MainWindow.SaveSettingsToFile();
break;
case "EnableProcessProtection":
sec.EnableProcessProtection = newState;
MainWindow.SaveSettingsToFile();