Files
community/Ink Canvas/Windows/SettingsViews/Pages/PowerPointPage.xaml
T
PrefacedCorg 3ab9fcc857 refactor(UI): 重构悬浮窗拦截设置界面布局
将悬浮窗拦截设置从LabeledSettingsCard改为SettingsCard和ToggleSwitch组合
优化界面结构,使开关控件更直观
添加Expander控制拦截规则的显示状态
2026-04-26 20:26:24 +08:00

281 lines
20 KiB
XML

<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.PowerPointPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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: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="{i18n:I18n Key=Nav_PPT_Settings}">
<ScrollViewer PanningMode="VerticalFirst">
<Grid Margin="59,0,59,0">
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
<Style.Setters>
<Setter Property="Margin" Value="1,30,0,6" />
</Style.Setters>
</Style>
</FrameworkElement.Resources>
<Grid>
<ikw:SimpleStackPanel MaxWidth="1000"
HorizontalAlignment="Stretch"
Spacing="{StaticResource SettingsCardSpacing}">
<TextBlock Text="{i18n:I18n Key=PPT_GroupTitle}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardSupportPowerPoint"
Header="{i18n:I18n Key=PPT_SupportPowerPoint}"
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
Toggled="ToggleSwitchSupportPowerPoint_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardPowerPointEnhancement"
Header="{i18n:I18n Key=PPT_Enhancement}"
Icon="{x:Static ui:SegoeFluentIcons.Puzzle}"
Toggled="ToggleSwitchPowerPointEnhancement_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSkipAnimationsWhenGoNext"
Header="{i18n:I18n Key=PPT_SkipAnimations}"
Icon="{x:Static ui:SegoeFluentIcons.FastForward}"
Toggled="ToggleSwitchSkipAnimationsWhenGoNext_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardUseRotPptLink"
Header="{i18n:I18n Key=PPT_UseRot}"
Icon="{x:Static ui:SegoeFluentIcons.Link}"
Toggled="ToggleSwitchUseRotPptLink_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSupportWPS"
Header="{i18n:I18n Key=PPT_SupportWPS}"
Icon="{x:Static ui:SegoeFluentIcons.Document}"
Toggled="ToggleSwitchSupportWPS_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardEnableWppProcessKill"
Header="{i18n:I18n Key=PPT_KillWppProcess}"
Description="{i18n:I18n Key=PPT_KillWppHint}"
Icon="{x:Static ui:SegoeFluentIcons.Cancel}"
Toggled="ToggleSwitchEnableWppProcessKill_Toggled"/>
<TextBlock Text="{i18n:I18n Key=PPT_FlipButtonsTitle}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardShowPPTButton"
Header="{i18n:I18n Key=PPT_ShowFlipButtons}"
Icon="{x:Static ui:SegoeFluentIcons.ShowResults}"
Toggled="ToggleSwitchShowPPTButton_OnToggled"/>
<ui:SettingsExpander Header="{i18n:I18n Key=PPT_Position_Left}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardShowPPTButton, Mode=OneWay}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.CaretSolidLeft}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Content>
<CheckBox x:Name="CheckboxEnableLSPPTButton" Checked="CheckboxEnableLSPPTButton_IsCheckChanged" Unchecked="CheckboxEnableLSPPTButton_IsCheckChanged"/>
</ui:SettingsExpander.Content>
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_LeftOffset}">
<Slider x:Name="PPTButtonLeftPositionValueSlider" Minimum="-500" Maximum="500" Width="200" ValueChanged="PPTButtonLeftPositionValueSlider_ValueChanged"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_LeftOpacity}" Visibility="{Binding IsChecked, ElementName=CheckboxSPPTHalfOpacity, Converter={StaticResource BooleanToVisibilityConverter}}">
<Slider x:Name="PPTLSButtonOpacityValueSlider" Minimum="0.1" Maximum="1.0" Width="200" ValueChanged="PPTLSButtonOpacityValueSlider_ValueChanged"/>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsExpander Header="{i18n:I18n Key=PPT_Position_Right}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardShowPPTButton, Mode=OneWay}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.CaretSolidRight}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Content>
<CheckBox x:Name="CheckboxEnableRSPPTButton" Checked="CheckboxEnableRSPPTButton_IsCheckChanged" Unchecked="CheckboxEnableRSPPTButton_IsCheckChanged"/>
</ui:SettingsExpander.Content>
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_RightOffset}">
<Slider x:Name="PPTButtonRightPositionValueSlider" Minimum="-500" Maximum="500" Width="200" ValueChanged="PPTButtonRightPositionValueSlider_ValueChanged"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_RightOpacity}" Visibility="{Binding IsChecked, ElementName=CheckboxSPPTHalfOpacity, Converter={StaticResource BooleanToVisibilityConverter}}">
<Slider x:Name="PPTRSButtonOpacityValueSlider" Minimum="0.1" Maximum="1.0" Width="200" ValueChanged="PPTRSButtonOpacityValueSlider_ValueChanged"/>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsExpander Header="{i18n:I18n Key=PPT_Position_LeftBottom}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardShowPPTButton, Mode=OneWay}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.CaretSolidDown}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Content>
<CheckBox x:Name="CheckboxEnableLBPPTButton" Checked="CheckboxEnableLBPPTButton_IsCheckChanged" Unchecked="CheckboxEnableLBPPTButton_IsCheckChanged"/>
</ui:SettingsExpander.Content>
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_LeftBottomOffset}">
<Slider x:Name="PPTButtonLBPositionValueSlider" Minimum="-500" Maximum="500" Width="200" ValueChanged="PPTButtonLBPositionValueSlider_ValueChanged"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_LeftBottomOpacity}" Visibility="{Binding IsChecked, ElementName=CheckboxBPPTHalfOpacity, Converter={StaticResource BooleanToVisibilityConverter}}">
<Slider x:Name="PPTLBButtonOpacityValueSlider" Minimum="0.1" Maximum="1.0" Width="200" ValueChanged="PPTLBButtonOpacityValueSlider_ValueChanged"/>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsExpander Header="{i18n:I18n Key=PPT_Position_RightBottom}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardShowPPTButton, Mode=OneWay}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.CaretSolidDown}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Content>
<CheckBox x:Name="CheckboxEnableRBPPTButton" Checked="CheckboxEnableRBPPTButton_IsCheckChanged" Unchecked="CheckboxEnableRBPPTButton_IsCheckChanged"/>
</ui:SettingsExpander.Content>
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_RightBottomOffset}">
<Slider x:Name="PPTButtonRBPositionValueSlider" Minimum="-500" Maximum="500" Width="200" ValueChanged="PPTButtonRBPositionValueSlider_ValueChanged"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_RightBottomOpacity}" Visibility="{Binding IsChecked, ElementName=CheckboxBPPTHalfOpacity, Converter={StaticResource BooleanToVisibilityConverter}}">
<Slider x:Name="PPTRBButtonOpacityValueSlider" Minimum="0.1" Maximum="1.0" Width="200" ValueChanged="PPTRBButtonOpacityValueSlider_ValueChanged"/>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_SideGroupTitle}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DockLeft}"/>
</ui:SettingsCard.HeaderIcon>
<ikw:SimpleStackPanel Orientation="Vertical" Spacing="6">
<CheckBox x:Name="CheckboxSPPTDisplayPage" Content="{i18n:I18n Key=PPT_ShowPageNumber}" Checked="CheckboxSPPTDisplayPage_IsCheckChange" Unchecked="CheckboxSPPTDisplayPage_IsCheckChange"/>
<CheckBox x:Name="CheckboxSPPTHalfOpacity" Content="{i18n:I18n Key=PPT_HalfOpacity}" Checked="CheckboxSPPTHalfOpacity_IsCheckChange" Unchecked="CheckboxSPPTHalfOpacity_IsCheckChange"/>
<CheckBox x:Name="CheckboxSPPTBlackBackground" Content="{i18n:I18n Key=PPT_BlackBackground}" Checked="CheckboxSPPTBlackBackground_IsCheckChange" Unchecked="CheckboxSPPTBlackBackground_IsCheckChange"/>
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_BottomGroupTitle}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DockBottom}"/>
</ui:SettingsCard.HeaderIcon>
<ikw:SimpleStackPanel Orientation="Vertical" Spacing="6">
<CheckBox x:Name="CheckboxBPPTDisplayPage" Content="{i18n:I18n Key=PPT_ShowPageNumber}" Checked="CheckboxBPPTDisplayPage_IsCheckChange" Unchecked="CheckboxBPPTDisplayPage_IsCheckChange"/>
<CheckBox x:Name="CheckboxBPPTHalfOpacity" Content="{i18n:I18n Key=PPT_HalfOpacity}" Checked="CheckboxBPPTHalfOpacity_IsCheckChange" Unchecked="CheckboxBPPTHalfOpacity_IsCheckChange"/>
<CheckBox x:Name="CheckboxBPPTBlackBackground" Content="{i18n:I18n Key=PPT_BlackBackground}" Checked="CheckboxBPPTBlackBackground_IsCheckChange" Unchecked="CheckboxBPPTBlackBackground_IsCheckChange"/>
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<controls:LabeledSettingsCard x:Name="CardEnablePPTButtonPageClickable"
Header="{i18n:I18n Key=PPT_PageButtonClickable}"
Description="{i18n:I18n Key=PPT_PageButtonClickableHint}"
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
Toggled="ToggleSwitchEnablePPTButtonPageClickable_OnToggled"/>
<controls:LabeledSettingsCard x:Name="CardEnablePPTButtonLongPressPageTurn"
Header="{i18n:I18n Key=PPT_LongPressPageTurn}"
Description="{i18n:I18n Key=PPT_LongPressPageTurnHint}"
Icon="{x:Static ui:SegoeFluentIcons.Touch}"
Visibility="{Binding IsOn, ElementName=CardShowPPTButton, Converter={StaticResource BooleanToVisibilityConverter}}"
Toggled="ToggleSwitchEnablePPTButtonLongPressPageTurn_OnToggled"/>
<TextBlock Text="{i18n:I18n Key=PPT_EnterAnnotationOnShow}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardShowCanvasAtNewSlideShow"
Header="{i18n:I18n Key=PPT_EnterAnnotationOnShow}"
Icon="{x:Static ui:SegoeFluentIcons.Edit}"
Toggled="ToggleSwitchShowCanvasAtNewSlideShow_Toggled"/>
<TextBlock Text="{i18n:I18n Key=Nav_PPT_Settings}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardEnableTwoFingerGestureInPresentationMode"
Header="{i18n:I18n Key=PPT_TwoFingerGesture}"
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
Toggled="ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardEnableFingerGestureSlideShowControl"
Header="{i18n:I18n Key=PPT_FingerGestureSlide}"
Description="{i18n:I18n Key=PPT_FingerGestureSlideHint}"
Icon="{x:Static ui:SegoeFluentIcons.Handwriting}"
Toggled="ToggleSwitchEnableFingerGestureSlideShowControl_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardShowGestureButtonInSlideShow"
Header="{i18n:I18n Key=PPT_ShowGestureButtonInShow}"
Description="{i18n:I18n Key=PPT_ShowGestureButtonInShowHint}"
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
Toggled="ToggleSwitchShowGestureButtonInSlideShow_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardEnablePPTTimeCapsule"
Header="{i18n:I18n Key=PPT_TimeCapsule}"
Description="{i18n:I18n Key=PPT_TimeCapsuleHint}"
Icon="{x:Static ui:SegoeFluentIcons.QuietHours}"
Toggled="ToggleSwitchEnablePPTTimeCapsule_Toggled"/>
<ui:SettingsCard Header="{i18n:I18n Key=PPT_TimeCapsulePosition}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Location}"/>
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxPPTTimeCapsulePosition"
SelectionChanged="ComboBoxPPTTimeCapsulePosition_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=PPT_TimeCapsulePos_TL}"/>
<ComboBoxItem Content="{i18n:I18n Key=PPT_TimeCapsulePos_TR}"/>
<ComboBoxItem Content="{i18n:I18n Key=PPT_TimeCapsulePos_Center}"/>
</ComboBox>
</ui:SettingsCard>
<controls:LabeledSettingsCard x:Name="CardShowPPTSidebarByDefault"
Header="{i18n:I18n Key=PPT_ShowQuickPanelInShow}"
Description="{i18n:I18n Key=PPT_ShowQuickPanelInShowHint}"
Icon="{x:Static ui:SegoeFluentIcons.OpenPane}"
Toggled="ToggleSwitchShowPPTSidebarByDefault_Toggled"/>
<TextBlock Text="{i18n:I18n Key=PPT_AutoScreenshot}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardAutoSaveScreenShotInPowerPoint"
Header="{i18n:I18n Key=PPT_AutoScreenshot}"
Description="{i18n:I18n Key=PPT_AutoScreenshotHint}"
Icon="{x:Static ui:SegoeFluentIcons.Camera}"
Toggled="ToggleSwitchAutoSaveScreenShotInPowerPoint_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesInPowerPoint"
Header="{i18n:I18n Key=PPT_AutoSaveStrokes}"
Description="{i18n:I18n Key=PPT_AutoSaveStrokesHint}"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchAutoSaveStrokesInPowerPoint_Toggled"/>
<TextBlock Text="{i18n:I18n Key=PPT_RememberLastPage}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardNotifyPreviousPage"
Header="{i18n:I18n Key=PPT_RememberLastPage}"
Description="{i18n:I18n Key=PPT_RememberLastPageHint}"
Icon="{x:Static ui:SegoeFluentIcons.History}"
Toggled="ToggleSwitchNotifyPreviousPage_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAlwaysGoToFirstPageOnReenter"
Header="{i18n:I18n Key=PPT_GoToFirstPageOnReenter}"
Icon="{x:Static ui:SegoeFluentIcons.Rewind}"
Toggled="ToggleSwitchAlwaysGoToFirstPageOnReenter_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardNotifyHiddenPage"
Header="{i18n:I18n Key=PPT_NotifyHiddenPage}"
Icon="{x:Static ui:SegoeFluentIcons.Hide}"
Toggled="ToggleSwitchNotifyHiddenPage_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardNotifyAutoPlayPresentation"
Header="{i18n:I18n Key=PPT_NotifyAutoPlay}"
Icon="{x:Static ui:SegoeFluentIcons.Play}"
Toggled="ToggleSwitchNotifyAutoPlayPresentation_Toggled"/>
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>