refactor(UI): 重构悬浮窗拦截设置界面布局

将悬浮窗拦截设置从LabeledSettingsCard改为SettingsCard和ToggleSwitch组合
优化界面结构,使开关控件更直观
添加Expander控制拦截规则的显示状态
This commit is contained in:
PrefacedCorg
2026-04-26 20:26:24 +08:00
parent 7ef231a4c7
commit 3ab9fcc857
3 changed files with 158 additions and 90 deletions
@@ -8,6 +8,7 @@
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
xmlns:c="clr-namespace:Ink_Canvas.Converter"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="自动化">
@@ -17,6 +18,7 @@
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
<sys:Double x:Key="SettingsCardHeaderIconMaxSize">24</sys:Double>
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
@@ -285,72 +287,134 @@
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchSaveFullPageStrokes_Toggled"/>
<TextBlock Text="悬浮窗拦截" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardFloatingWindowInterceptorEnabled"
<ui:SettingsExpander x:Name="ExpanderFloatingWindowInterceptor"
Header="启用悬浮窗拦截"
Icon="{x:Static ui:SegoeFluentIcons.Shield}"
Toggled="ToggleSwitchFloatingWindowInterceptorEnabled_Toggled"/>
<ui:SettingsExpander Header="拦截规则"
Visibility="{Binding IsOn, ElementName=CardFloatingWindowInterceptorEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardFloatingWindowInterceptorEnabled, Mode=OneWay}">
d:IsExpanded="True">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Filter}"/>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Shield}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchFloatingWindowInterceptorEnabled"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchFloatingWindowInterceptorEnabled_Toggled"/>
<ui:SettingsExpander.Items>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard3Floating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard3}"
IconSource="/Resources/Icons-png/EasiNote3.png"
Toggled="ToggleSwitchSeewoWhiteboard3Floating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard5Floating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5}"
IconSource="/Resources/Icons-png/EasiNote.png"
Toggled="ToggleSwitchSeewoWhiteboard5Floating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard5CFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5C}"
IconSource="/Resources/Icons-png/EasiNote5C.png"
Toggled="ToggleSwitchSeewoWhiteboard5CFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPincoSideBarFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPinco}"
IconSource="/Resources/Icons-png/SeewoPinco.png"
Toggled="ToggleSwitchSeewoPincoSideBarFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPincoDrawingFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPincoDrawing}"
IconSource="/Resources/Icons-png/SeewoPinco.png"
Toggled="ToggleSwitchSeewoPincoDrawingFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPPTFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPPTTools}"
IconSource="/Resources/Icons-png/PPTTools.png"
Toggled="ToggleSwitchSeewoPPTFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAiClassFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_AiClass}"
IconSource="/Resources/Icons-png/AiClass.png"
Toggled="ToggleSwitchAiClassFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardHiteAnnotationFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_HiteAnnotation}"
IconSource="/Resources/Icons-png/HiteAnnotation.png"
Toggled="ToggleSwitchHiteAnnotationFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardChangYanFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanClass}"
IconSource="/Resources/Icons-png/畅言智慧课堂.png"
Toggled="ToggleSwitchChangYanFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardChangYanPptFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanPPT}"
IconSource="/Resources/Icons-png/畅言智慧课堂.png"
Toggled="ToggleSwitchChangYanPptFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardIntelligentClassFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_IntelligentClass}"
IconSource="/Resources/Icons-png/天喻教育云.png"
Toggled="ToggleSwitchIntelligentClassFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoDesktopAnnotationFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopAnnotation}"
IconSource="/Resources/Icons-png/Seewo2Annotation.png"
Toggled="ToggleSwitchSeewoDesktopAnnotationFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoDesktopSideBarFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopSideBar}"
IconSource="/Resources/Icons-png/Seewo2Annotation.png"
Toggled="ToggleSwitchSeewoDesktopSideBarFloating_Toggled"/>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard3}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/EasiNote3.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoWhiteboard3Floating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoWhiteboard3Floating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/EasiNote.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoWhiteboard5Floating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoWhiteboard5Floating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5C}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/EasiNote5C.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoWhiteboard5CFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoWhiteboard5CFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPinco}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/SeewoPinco.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoPincoSideBarFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoPincoSideBarFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPincoDrawing}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/SeewoPinco.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoPincoDrawingFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoPincoDrawingFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPPTTools}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/PPTTools.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoPPTFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoPPTFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_AiClass}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/AiClass.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchAiClassFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchAiClassFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_HiteAnnotation}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/HiteAnnotation.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchHiteAnnotationFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchHiteAnnotationFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanClass}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/畅言智慧课堂.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchChangYanFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchChangYanFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanPPT}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/畅言智慧课堂.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchChangYanPptFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchChangYanPptFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_IntelligentClass}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/天喻教育云.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchIntelligentClassFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchIntelligentClassFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopAnnotation}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/Seewo2Annotation.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoDesktopAnnotationFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoDesktopAnnotationFloating_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopSideBar}">
<ui:SettingsCard.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/Seewo2Annotation.png"/>
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchSeewoDesktopSideBarFloating"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchSeewoDesktopSideBarFloating_Toggled"/>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>