-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
327 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...oard_Sticker/Pages/SettingsPages/TimetableSettingsPages/TimetableGenericSettingsPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<Page x:Class="ZongziTEK_Blackboard_Sticker.Pages.SettingsPages.TimetableSettingsPages.TimetableGenericSettingsPage" | ||
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:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" | ||
xmlns:card="clr-namespace:ZongziTEK_Blackboard_Sticker.Controls.Cards" | ||
xmlns:local="clr-namespace:ZongziTEK_Blackboard_Sticker.Pages.SettingsPages" | ||
mc:Ignorable="d" | ||
d:DesignHeight="1600" d:DesignWidth="800" | ||
Title="TimetableGenericSettingsPage"> | ||
|
||
<Grid> | ||
<ui:ScrollViewerEx> | ||
<ikw:SimpleStackPanel Spacing="8" Margin="24"> | ||
<Label FontSize="24" Margin="12,8,0,-4" FontWeight="Bold" Content="课程表"/> | ||
<Label FontSize="14" Margin="12,0,0,8" Content="常规" Opacity="0.8"/> | ||
<card:SliderCard Icon="{x:Static ui:FluentSystemIcons.TextFontSize_20_Regular}" Header="课程表字号" Minimum="18" Maximum="40" TickFrequency="1" | ||
Value="{Binding FontSize, Mode=TwoWay}" ValueChanged="SliderFontSize_ValueChanged"/> | ||
<card:ToggleSwitchCard x:Name="ToggleSwitchUseTimetable" Icon="{x:Static ui:FluentSystemIcons.Timeline_20_Regular}" | ||
Header="使用带时间信息的课程表" Tip="关闭后,课程表将变为纯文本,失去一切与时间有关的功能" OnContent="启用" OffContent="禁用" | ||
IsOn="{Binding IsTimetableEnabled, Mode=TwoWay}" Toggled="ToggleSwitchUseTimetable_Toggled" | ||
d:IsOn="True"/> | ||
<ikw:SimpleStackPanel Spacing="8" Visibility="{Binding ElementName=ToggleSwitchUseTimetable, Path=IsOn, Converter={StaticResource BoolToVisibilityConverter}}"> | ||
<card:ToggleSwitchCard Icon="{x:Static ui:FluentSystemIcons.Alert_20_Regular}" Header="上下课提醒" Tip="此设置不会影响语音播报" OnContent="启用" OffContent="禁用" | ||
IsOn="{Binding IsTimetableNotificationEnabled, Mode=TwoWay}" Toggled="ToggleSwitchIsTimetableNotificationEnabled_Toggled"/> | ||
<card:SliderCard Icon="{x:Static ui:FluentSystemIcons.ArrowEnter_20_Regular}" Header="课前通知持续时间(秒)" Minimum="20" Maximum="180" TickFrequency="2.5" | ||
Value="{Binding BeginNotificationTime, Mode=TwoWay}" ValueChanged="SliderBeginNotificationTime_ValueChanged"/> | ||
<card:SliderCard Icon="{x:Static ui:FluentSystemIcons.PersonRunning_20_Regular}" Header="下课通知持续时间(秒)" Minimum="4" Maximum="60" TickFrequency="1" | ||
Value="{Binding OverNotificationTime, Mode=TwoWay}" ValueChanged="SliderOverNotificationTime_ValueChanged"/> | ||
<card:SliderCard Icon="{x:Static ui:FluentSystemIcons.ShiftsActivity_20_Regular}" | ||
Header="时间补偿(秒)" Tip="当学校铃声时间与黑板贴上下课提醒出现时间不一致时,请修改此值。正值为提前,负值为延后。" | ||
Minimum="-30" Maximum="30" TickFrequency="1" | ||
Value="{Binding TimeOffset, Mode=TwoWay}" ValueChanged="SliderTimeOffset_ValueChanged"/> | ||
<Border HorizontalAlignment="Stretch" Background="{DynamicResource {x:Static ui:ThemeKeys.CardBackgroundFillColorDefaultBrushKey}}" | ||
CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0"> | ||
</Border> | ||
</ikw:SimpleStackPanel> | ||
</ikw:SimpleStackPanel> | ||
</ui:ScrollViewerEx> | ||
</Grid> | ||
</Page> |
64 changes: 64 additions & 0 deletions
64
...d_Sticker/Pages/SettingsPages/TimetableSettingsPages/TimetableGenericSettingsPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace ZongziTEK_Blackboard_Sticker.Pages.SettingsPages.TimetableSettingsPages | ||
{ | ||
/// <summary> | ||
/// TimetableGenericSettingsPage.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class TimetableGenericSettingsPage : Page | ||
{ | ||
public TimetableGenericSettingsPage() | ||
{ | ||
InitializeComponent(); | ||
|
||
DataContext = MainWindow.Settings.TimetableSettings; | ||
} | ||
|
||
private void ToggleSwitchUseTimetable_Toggled(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
|
||
(Application.Current.MainWindow as MainWindow).LoadTimetableOrCurriculum(); | ||
} | ||
|
||
private void ToggleSwitchIsTimetableNotificationEnabled_Toggled(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
} | ||
|
||
private void SliderBeginNotificationTime_ValueChanged(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
} | ||
|
||
private void SliderOverNotificationTime_ValueChanged(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
} | ||
|
||
private void SliderFontSize_ValueChanged(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
|
||
(Application.Current.MainWindow as MainWindow).LoadTimetableOrCurriculum(); | ||
} | ||
|
||
private void SliderTimeOffset_ValueChanged(object sender, RoutedEventArgs e) | ||
{ | ||
MainWindow.SaveSettings(); | ||
} | ||
} | ||
} |
Oops, something went wrong.