Files
community/Ink Canvas/Windows/SettingsViews/Pages/StartupPage.xaml
T

139 lines
8.1 KiB
XML
Raw Normal View History

2026-04-07 23:32:20 +08:00
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.StartupPage"
2026-03-29 12:38:46 +08:00
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"
2026-04-05 21:50:53 +08:00
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
2026-04-19 08:35:22 +08:00
xmlns:helpers="clr-namespace:Ink_Canvas.Windows.SettingsViews.Helpers"
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:sys="clr-namespace:System;assembly=mscorlib"
2026-04-18 22:32:08 +08:00
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
2026-04-19 14:42:11 +08:00
xmlns:c="clr-namespace:Ink_Canvas.Converter"
mc:Ignorable="d"
2026-04-07 23:46:26 +08:00
2026-03-29 17:39:52 +08:00
Title="启动">
2026-03-29 12:38:46 +08:00
2026-04-07 23:58:17 +08:00
<ScrollViewer PanningMode="VerticalFirst">
<Grid Margin="59,0,59,0">
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
2026-04-19 14:42:11 +08:00
<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>
2026-04-07 23:58:17 +08:00
<Grid>
<ikw:SimpleStackPanel MaxWidth="1000"
HorizontalAlignment="Stretch"
Spacing="{StaticResource SettingsCardSpacing}">
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 窗口设置 -->
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="窗口设置" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 窗口无焦点模式 -->
2026-04-18 22:32:08 +08:00
<controls:LabeledSettingsCard x:Name="CardNoFocusMode"
Header="{i18n:I18n Key=Startup_NoFocusMode}"
Description="{i18n:I18n Key=Startup_NoFocusModeHint}"
Icon="{x:Static ui:SegoeFluentIcons.View}"
SwitchName="ToggleSwitchNoFocusMode"
Toggled="ToggleSwitchNoFocusMode_Toggled" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 窗口无边框模式 -->
2026-04-18 22:32:08 +08:00
<controls:LabeledSettingsCard x:Name="CardWindowMode"
Header="{i18n:I18n Key=Startup_NoBorderMode}"
Description="{i18n:I18n Key=Startup_NoBorderModeHint}"
Icon="{x:Static ui:SegoeFluentIcons.FullScreen}"
SwitchName="ToggleSwitchWindowMode"
Toggled="ToggleSwitchWindowMode_Toggled" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 窗口置顶 -->
2026-04-18 22:32:08 +08:00
<ui:SettingsExpander x:Name="ExpanderAlwaysOnTop"
Header="{i18n:I18n Key=Startup_TopMost}"
Description="{i18n:I18n Key=Startup_TopMostHint}"
d:IsExpanded="True">
2026-04-18 22:32:08 +08:00
<ui:SettingsExpander.HeaderIcon>
2026-04-07 23:58:17 +08:00
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
2026-04-18 22:32:08 +08:00
</ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchAlwaysOnTop"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchAlwaysOnTop_Toggled" />
<ui:SettingsExpander.ItemTemplate>
2026-04-19 08:35:22 +08:00
<helpers:TopMostModeTemplateSelector>
<helpers:TopMostModeTemplateSelector.SelectionTemplate>
2026-04-18 22:32:08 +08:00
<DataTemplate>
<ui:SettingsCard Header="{i18n:I18n Key=Startup_TopMostMode}">
<StackPanel Orientation="Horizontal">
<RadioButton Content="{i18n:I18n Key=Startup_TopMostMode_Normal}"
GroupName="TopMostMode"
Checked="RadioTopMostNormal_Checked"
Loaded="RadioTopMostNormal_Loaded"
Margin="0,0,16,0" />
<RadioButton Content="{i18n:I18n Key=Startup_TopMostMode_UIA}"
GroupName="TopMostMode"
Checked="RadioTopMostUIA_Checked"
Loaded="RadioTopMostUIA_Loaded" />
</StackPanel>
</ui:SettingsCard>
</DataTemplate>
2026-04-19 08:35:22 +08:00
</helpers:TopMostModeTemplateSelector.SelectionTemplate>
<helpers:TopMostModeTemplateSelector.ButtonTemplate>
2026-04-18 22:32:08 +08:00
<DataTemplate>
<ui:SettingsCard Header="{Binding ButtonHeader}">
<Button Content="{Binding ButtonContent}"
Click="BtnRestart_Click"
Tag="{Binding RestartAsAdmin}" />
</ui:SettingsCard>
</DataTemplate>
2026-04-19 08:35:22 +08:00
</helpers:TopMostModeTemplateSelector.ButtonTemplate>
</helpers:TopMostModeTemplateSelector>
2026-04-18 22:32:08 +08:00
</ui:SettingsExpander.ItemTemplate>
</ui:SettingsExpander>
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 启动设置 -->
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="启动设置" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 开机时运行 -->
2026-04-18 22:32:08 +08:00
<controls:LabeledSettingsCard x:Name="CardRunAtStartup"
Header="{i18n:I18n Key=Startup_RunAtStartup}"
Description="{i18n:I18n Key=Startup_RunAtStartupHint}"
Icon="{x:Static ui:SegoeFluentIcons.Settings}"
SwitchName="ToggleSwitchRunAtStartup"
Toggled="ToggleSwitchRunAtStartup_Toggled" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
<!-- 开机运行后收纳到侧边栏 -->
2026-04-18 22:32:08 +08:00
<controls:LabeledSettingsCard x:Name="CardFoldAtStartup"
Header="{i18n:I18n Key=Startup_FoldAtStartup}"
Description="{i18n:I18n Key=Startup_FoldAtStartupHint}"
Icon="{x:Static ui:SegoeFluentIcons.ChevronLeft}"
SwitchName="ToggleSwitchFoldAtStartup"
Toggled="ToggleSwitchFoldAtStartup_Toggled" />
2026-04-19 14:42:11 +08:00
<!-- 运行模式 -->
2026-04-07 23:58:17 +08:00
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
2026-04-19 14:42:11 +08:00
Text="{i18n:I18n Key=Settings_ModeDesc_1}" />
2026-04-04 15:40:36 +08:00
2026-04-19 14:42:11 +08:00
<controls:LabeledSettingsCard x:Name="CardPPTOnlyMode"
Header="{i18n:I18n Key=Mode_PPTOnly}"
Description="{i18n:I18n Key=Settings_ModeDesc}"
Icon="{x:Static ui:SegoeFluentIcons.Settings}"
SwitchName="ToggleSwitchPPTOnlyMode"
Toggled="ToggleSwitchPPTOnlyMode_Toggled" />
2026-04-05 17:31:15 +08:00
2026-04-07 23:58:17 +08:00
<!-- 底部空白 -->
<Rectangle Height="48" />
2026-04-04 11:33:47 +08:00
2026-04-07 23:58:17 +08:00
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
2026-04-07 23:32:20 +08:00
</ui:Page>