Files
community/Ink Canvas/Windows/SettingsViews/Pages/RandomDrawPage.xaml
T
PrefacedCorg f3ef2f7aec feat(设置): 新增高级设置和随机点名设置页面
refactor: 将高级和随机点名设置从主窗口迁移到独立页面
style: 优化墨迹识别页面的高精度直线拉直开关样式
fix: 修复URI处理中未刷新配置列表的问题
2026-04-25 20:26:56 +08:00

208 lines
12 KiB
XML

<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.RandomDrawPage"
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:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="{i18n:I18n Key=Random_Title}">
<ScrollViewer PanningMode="VerticalFirst">
<Grid Margin="59,0,59,0">
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
<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 Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Random_Title}" />
<ui:SettingsCard Header="{i18n:I18n Key=Random_ShowEditNamesButton}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Edit}" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch x:Name="ToggleSwitchDisplayRandWindowNamesInputBtn"
IsOn="True"
Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_EnableButtons}">
<ui:ToggleSwitch x:Name="ToggleSwitchShowRandomAndSingleDraw"
IsOn="True"
Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_EnableQuickButton}">
<ui:ToggleSwitch x:Name="ToggleSwitchEnableQuickDraw"
IsOn="True"
Toggled="ToggleSwitchEnableQuickDraw_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_UseExternal}">
<ui:ToggleSwitch x:Name="ToggleSwitchExternalCaller"
IsOn="False"
Toggled="ToggleSwitchExternalCaller_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_ExternalTypeLabel}">
<ComboBox x:Name="ComboBoxExternalCallerType"
SelectedIndex="0"
SelectionChanged="ComboBoxExternalCallerType_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Random_ExternalType_ClassIsland}" />
<ComboBoxItem Content="{i18n:I18n Key=Random_ExternalType_SecRandom}" />
<ComboBoxItem Content="{i18n:I18n Key=Random_ExternalType_NamePicker}" />
</ComboBox>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_OnceCloseDelay}">
<Slider x:Name="RandWindowOnceCloseLatencySlider"
Minimum="0.5" Maximum="8" Width="200"
IsSnapToTickEnabled="True" Value="2.5"
TickFrequency="0.1" TickPlacement="None"
ValueChanged="RandWindowOnceCloseLatencySlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_OnceMaxStudents}">
<Slider x:Name="RandWindowOnceMaxStudentsSlider"
Minimum="0" Maximum="20" Width="200"
IsSnapToTickEnabled="True" Value="10" TickFrequency="1"
TickPlacement="None"
ValueChanged="RandWindowOnceMaxStudentsSlider_ValueChanged" />
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Random_BackgroundSettingsTitle}" />
<ui:SettingsCard Header="{i18n:I18n Key=Random_BackgroundSelectLabel}">
<ComboBox x:Name="ComboBoxPickNameBackground"
SelectedIndex="0"
SelectionChanged="ComboBoxPickNameBackground_SelectionChanged" />
</ui:SettingsCard>
<ui:SettingsCard ContentAlignment="Left">
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
<Button x:Name="ButtonAddCustomBackground" Content="{i18n:I18n Key=Random_CustomBackground_Upload}" Click="ButtonAddCustomBackground_Click" />
<Button x:Name="ButtonManageBackgrounds" Content="{i18n:I18n Key=Random_CustomBackground_Manage}" Click="ButtonManageBackgrounds_Click" />
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Random_NewUI_Title}" />
<ui:SettingsCard Header="{i18n:I18n Key=Random_NewUI_Enable}">
<ui:ToggleSwitch x:Name="ToggleSwitchUseNewRollCallUI"
IsOn="True"
Toggled="ToggleSwitchUseNewRollCallUI_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_ML_AvoidRepeat}">
<ui:ToggleSwitch x:Name="ToggleSwitchEnableMLAvoidance"
IsOn="True"
Toggled="ToggleSwitchEnableMLAvoidance_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_ML_HistoryCount}">
<Slider x:Name="MLAvoidanceHistorySlider"
Minimum="5" Maximum="50" Width="200"
IsSnapToTickEnabled="True" Value="50" TickFrequency="5"
TickPlacement="None"
ValueChanged="MLAvoidanceHistorySlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Random_ML_Weight}">
<Slider x:Name="MLAvoidanceWeightSlider"
Minimum="0.1" Maximum="1.0" Width="200"
IsSnapToTickEnabled="True" Value="1.0" TickFrequency="0.1"
TickPlacement="None"
ValueChanged="MLAvoidanceWeightSlider_ValueChanged" />
</ui:SettingsCard>
<TextBlock Text="{i18n:I18n Key=Random_ML_Hint}"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
TextWrapping="Wrap" Margin="1,0,0,4" />
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Text="{i18n:I18n Key=Timer_Title}" />
<ui:SettingsCard Header="{i18n:I18n Key=Timer_UseLegacyButtons}">
<ui:ToggleSwitch x:Name="ToggleSwitchUseLegacyTimerUI"
IsOn="False"
Toggled="ToggleSwitchUseLegacyTimerUI_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_NewUI}">
<ui:ToggleSwitch x:Name="ToggleSwitchUseNewStyleUI"
IsOn="False"
Toggled="ToggleSwitchUseNewStyleUI_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_EnableCountUp}">
<ui:ToggleSwitch x:Name="ToggleSwitchEnableOvertimeCountUp"
IsOn="False"
Toggled="ToggleSwitchEnableOvertimeCountUp_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_OvertimeHighlight}">
<ui:ToggleSwitch x:Name="ToggleSwitchEnableOvertimeRedText"
IsOn="True"
Toggled="ToggleSwitchEnableOvertimeRedText_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_Volume}">
<Slider x:Name="TimerVolumeSlider"
Minimum="0" Maximum="1" Width="200"
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.1"
TickPlacement="None"
ValueChanged="TimerVolumeSlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_CustomSoundLabel}">
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
<Button x:Name="ButtonSelectCustomTimerSound" Content="{i18n:I18n Key=Timer_SelectFile}" Click="ButtonSelectCustomTimerSound_Click" />
<Button x:Name="ButtonResetTimerSound" Content="{i18n:I18n Key=Timer_Reset}" Click="ButtonResetTimerSound_Click" />
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_Progressive}">
<ui:ToggleSwitch x:Name="ToggleSwitchEnableProgressiveReminder"
IsOn="False"
Toggled="ToggleSwitchEnableProgressiveReminder_Toggled"/>
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_ProgressiveVolume}">
<Slider x:Name="ProgressiveReminderVolumeSlider"
Minimum="0" Maximum="1" Width="200"
IsSnapToTickEnabled="True" Value="1" TickFrequency="0.1"
TickPlacement="None"
ValueChanged="ProgressiveReminderVolumeSlider_ValueChanged" />
</ui:SettingsCard>
<ui:SettingsCard Header="{i18n:I18n Key=Timer_ProgressiveCustomLabel}">
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
<Button x:Name="ButtonSelectCustomProgressiveReminderSound" Content="{i18n:I18n Key=Timer_ProgressiveSelectFile}" Click="ButtonSelectCustomProgressiveReminderSound_Click" />
<Button x:Name="ButtonResetProgressiveReminderSound" Content="{i18n:I18n Key=Timer_ProgressiveReset}" Click="ButtonResetProgressiveReminderSound_Click" />
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>