improve:主题切换
This commit is contained in:
@@ -67,4 +67,39 @@
|
||||
<BitmapImage x:Key="GeoIconRectangle" UriSource="/Resources/Icons-png/geo-icons/square_white.png"/>
|
||||
<BitmapImage x:Key="GeoIconCylinder" UriSource="/Resources/Icons-png/geo-icons/cylinder_white.png"/>
|
||||
<BitmapImage x:Key="GeoIconCone" UriSource="/Resources/Icons-png/geo-icons/cone_white.png"/>
|
||||
|
||||
<!-- 点名窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="RandWindowBackground" Color="#1f1f1f"/>
|
||||
<SolidColorBrush x:Key="RandWindowBorderBrush" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="RandWindowTextForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="RandWindowButtonBackground" Color="#FBFBFD"/>
|
||||
<SolidColorBrush x:Key="RandWindowButtonForeground" Color="Black"/>
|
||||
<SolidColorBrush x:Key="RandWindowPrimaryButtonBackground" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="RandWindowPrimaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="RandWindowSecondaryButtonBackground" Color="#00B894"/>
|
||||
<SolidColorBrush x:Key="RandWindowSecondaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="RandWindowCloseButtonBackground" Color="#E32A34"/>
|
||||
<SolidColorBrush x:Key="RandWindowCloseButtonForeground" Color="White"/>
|
||||
|
||||
<!-- 倒计时窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="TimerWindowBackground" Color="#1f1f1f"/>
|
||||
<SolidColorBrush x:Key="TimerWindowBorderBrush" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="TimerWindowTextForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="TimerWindowButtonBackground" Color="#FBFBFD"/>
|
||||
<SolidColorBrush x:Key="TimerWindowButtonForeground" Color="Black"/>
|
||||
<SolidColorBrush x:Key="TimerWindowPrimaryButtonBackground" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="TimerWindowPrimaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="TimerWindowStopTimeBackground" Color="#2a2a2a"/>
|
||||
<SolidColorBrush x:Key="TimerWindowStopTimeForeground" Color="White"/>
|
||||
|
||||
<!-- 倒计时窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowBackground" Color="#1f1f1f"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowBorderBrush" Color="#E0E0E0"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowTextForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowButtonBackground" Color="#2a2a2a"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowDigitForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowTitleForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowPrimaryButtonBackground" Color="#4CAF50"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowPrimaryButtonForeground" Color="White"/>
|
||||
</ResourceDictionary>
|
||||
@@ -67,4 +67,39 @@
|
||||
<BitmapImage x:Key="GeoIconRectangle" UriSource="/Resources/Icons-png/geo-icons/square.png"/>
|
||||
<BitmapImage x:Key="GeoIconCylinder" UriSource="/Resources/Icons-png/geo-icons/cylinder.png"/>
|
||||
<BitmapImage x:Key="GeoIconCone" UriSource="/Resources/Icons-png/geo-icons/cone.png"/>
|
||||
|
||||
<!-- 点名窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="RandWindowBackground" Color="#F0F3F9"/>
|
||||
<SolidColorBrush x:Key="RandWindowBorderBrush" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="RandWindowTextForeground" Color="Black"/>
|
||||
<SolidColorBrush x:Key="RandWindowButtonBackground" Color="#FBFBFD"/>
|
||||
<SolidColorBrush x:Key="RandWindowButtonForeground" Color="Black"/>
|
||||
<SolidColorBrush x:Key="RandWindowPrimaryButtonBackground" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="RandWindowPrimaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="RandWindowSecondaryButtonBackground" Color="#00B894"/>
|
||||
<SolidColorBrush x:Key="RandWindowSecondaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="RandWindowCloseButtonBackground" Color="#E32A34"/>
|
||||
<SolidColorBrush x:Key="RandWindowCloseButtonForeground" Color="White"/>
|
||||
|
||||
<!-- 倒计时窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="TimerWindowBackground" Color="#F0F3F9"/>
|
||||
<SolidColorBrush x:Key="TimerWindowBorderBrush" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="TimerWindowTextForeground" Color="#5B5D5F"/>
|
||||
<SolidColorBrush x:Key="TimerWindowButtonBackground" Color="#FBFBFD"/>
|
||||
<SolidColorBrush x:Key="TimerWindowButtonForeground" Color="Black"/>
|
||||
<SolidColorBrush x:Key="TimerWindowPrimaryButtonBackground" Color="#0066BF"/>
|
||||
<SolidColorBrush x:Key="TimerWindowPrimaryButtonForeground" Color="White"/>
|
||||
<SolidColorBrush x:Key="TimerWindowStopTimeBackground" Color="#E8EAF0"/>
|
||||
<SolidColorBrush x:Key="TimerWindowStopTimeForeground" Color="Black"/>
|
||||
|
||||
<!-- 倒计时窗口主题颜色 -->
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowBackground" Color="White"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowBorderBrush" Color="#E0E0E0"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowTextForeground" Color="#333333"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowButtonBackground" Color="#F0F0F0"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowButtonForeground" Color="#666666"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowDigitForeground" Color="#333333"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowTitleForeground" Color="#333333"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowPrimaryButtonBackground" Color="#4CAF50"/>
|
||||
<SolidColorBrush x:Key="SeewoTimerWindowPrimaryButtonForeground" Color="White"/>
|
||||
</ResourceDictionary>
|
||||
@@ -10,7 +10,7 @@
|
||||
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
|
||||
Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
|
||||
Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100">
|
||||
<Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="60">
|
||||
<Border Background="{DynamicResource TimerWindowBackground}" CornerRadius="10" BorderThickness="1" BorderBrush="{DynamicResource TimerWindowBorderBrush}" Margin="60">
|
||||
<Grid>
|
||||
<TextBlock x:Name="TbCurrentTime" MouseDown="BtnMinimal_OnMouseUp" Visibility="Collapsed" FontSize="56" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<Border MouseMove="WindowDragMove" Visibility="{Binding ElementName=TbCurrentTime, Path=Visibility}" Width="64" Height="15" CornerRadius="8" Background="Gray" Margin="0,0,0,5" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
|
||||
@@ -22,7 +22,7 @@
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock Name="TextBlockHour" FontFamily="Segeo UI"
|
||||
Margin="0,0,0,0" Visibility="Collapsed"
|
||||
Foreground="#5B5D5F"
|
||||
Foreground="{DynamicResource TimerWindowTextForeground}"
|
||||
Text="00" FontSize="26"/>
|
||||
<ItemsControl Name="TextControlHour" ItemsSource="{Binding ElementName=TextBlockHour, Path=Text}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -69,7 +69,7 @@
|
||||
FontWeight="DemiBold"/>
|
||||
<TextBlock Name="TextBlockMinute" FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
|
||||
Margin="0,0,0,0" Visibility="Collapsed"
|
||||
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
||||
Foreground="{DynamicResource TimerWindowTextForeground}"
|
||||
Text="01" FontSize="26"/>
|
||||
<ItemsControl Name="TextControlMinute" ItemsSource="{Binding ElementName=TextBlockMinute, Path=Text}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -128,7 +128,7 @@
|
||||
FontWeight="DemiBold"/>
|
||||
<TextBlock Name="TextBlockSecond" FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
|
||||
Margin="0,0,0,0" Visibility="Collapsed"
|
||||
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
||||
Foreground="{DynamicResource TimerWindowTextForeground}"
|
||||
Text="00" FontSize="26"/>
|
||||
<ItemsControl Name="TextControlSecond" ItemsSource="{Binding ElementName=TextBlockSecond, Path=Text}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
@@ -167,17 +167,17 @@
|
||||
</ui:SimpleStackPanel>
|
||||
</Grid>
|
||||
</ui:SimpleStackPanel>
|
||||
<Border x:Name="BorderStopTime" Background="#E8EAF0" Margin="0,23,0,0"
|
||||
<Border x:Name="BorderStopTime" Background="{DynamicResource TimerWindowStopTimeBackground}" Margin="0,23,0,0"
|
||||
Height="18" CornerRadius="9"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<ui:SimpleStackPanel Margin="6,0" Spacing="0" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Image Margin="0,0,2,0" Source="/Resources/Icons-Fluent/ic_fluent_clock_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="10" Width="10"/>
|
||||
<TextBlock Name="TextBlockStopTime" Text="12:30 PM" FontSize="9" VerticalAlignment="Center"/>
|
||||
<TextBlock Name="TextBlockStopTime" Text="12:30 PM" FontSize="9" VerticalAlignment="Center" Foreground="{DynamicResource TimerWindowStopTimeForeground}"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Visibility="{Binding ElementName=ProcessBarTime, Path=Visibility}" Spacing="10" Orientation="Horizontal" Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom">
|
||||
<Grid>
|
||||
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="#0066BF" Height="20" Width="20" CornerRadius="100">
|
||||
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="{DynamicResource TimerWindowPrimaryButtonBackground}" Height="20" Width="20" CornerRadius="100">
|
||||
<Viewbox Margin="5">
|
||||
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Play" Foreground="White"/>
|
||||
</Viewbox>
|
||||
@@ -189,12 +189,12 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Border x:Name="BtnReset" MouseUp="BtnReset_MouseUp" Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
|
||||
<Border x:Name="BtnReset" MouseUp="BtnReset_MouseUp" Background="{DynamicResource TimerWindowButtonBackground}" Height="20" Width="20" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
<Viewbox Margin="5.5">
|
||||
<ui:SymbolIcon Symbol="Refresh" Foreground="Black"/>
|
||||
<ui:SymbolIcon Symbol="Refresh" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
|
||||
@@ -210,22 +210,22 @@
|
||||
<ui:SimpleStackPanel Height="180" Orientation="Horizontal">
|
||||
<Border x:Name="BtnMinimal" Visibility="{Binding ElementName=BorderStopTime, Path=Visibility}" MouseUp="BtnMinimal_OnMouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Margin="5"
|
||||
Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
|
||||
Background="{DynamicResource TimerWindowButtonBackground}" Height="20" Width="20" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
<Viewbox Margin="5.5">
|
||||
<ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="Black"/>
|
||||
<ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Margin="5"
|
||||
Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
|
||||
Background="{DynamicResource TimerWindowButtonBackground}" Height="20" Width="20" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
<Viewbox Margin="5.5">
|
||||
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
|
||||
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="{DynamicResource TimerWindowButtonForeground}"/>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
|
||||
@@ -22,6 +22,9 @@ namespace Ink_Canvas
|
||||
timer.Elapsed += Timer_Elapsed;
|
||||
timer.Interval = 50;
|
||||
InitializeUI();
|
||||
|
||||
// 应用主题
|
||||
ApplyTheme();
|
||||
}
|
||||
|
||||
public static Window CreateTimerWindow()
|
||||
@@ -358,6 +361,25 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 根据主题设置文本颜色
|
||||
var textForeground = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush;
|
||||
if (textForeground != null)
|
||||
{
|
||||
TextBlockHour.Foreground = textForeground;
|
||||
TextBlockMinute.Foreground = textForeground;
|
||||
TextBlockSecond.Foreground = textForeground;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用倒计时窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshUI()
|
||||
{
|
||||
InitializeUI();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Loaded="Window_Loaded"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="Ink Canvas 抽奖" Height="500" Width="900">
|
||||
<Border x:Name="MainBorder" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="0" ClipToBounds="True">
|
||||
<Border x:Name="MainBorder" CornerRadius="10" BorderThickness="1" BorderBrush="{DynamicResource RandWindowBorderBrush}" Margin="0" ClipToBounds="True">
|
||||
<Border.Background>
|
||||
<ImageBrush x:Name="BackgroundImage" Stretch="UniformToFill" Opacity="1.0"/>
|
||||
</Border.Background>
|
||||
@@ -21,14 +21,14 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Viewbox HorizontalAlignment="Center" Margin="20,0">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="50" MinHeight="470">
|
||||
<Label Name="LabelOutput" FontSize="130" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Label Name="LabelOutput2" FontSize="130" Visibility="Collapsed" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Label Name="LabelOutput3" FontSize="130" Visibility="Collapsed" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Label Name="LabelOutput" FontSize="130" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
<Label Name="LabelOutput2" FontSize="130" Visibility="Collapsed" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
<Label Name="LabelOutput3" FontSize="130" Visibility="Collapsed" Content="" Block.TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Viewbox>
|
||||
<ui:SimpleStackPanel Spacing="8" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Opacity="1" Name="PeopleControlPane" Width="256">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border x:Name="BorderBtnMinus" MouseUp="BorderBtnMinus_MouseUp" Background="#FBFBFD" Height="70" Width="70" CornerRadius="100">
|
||||
<Border x:Name="BorderBtnMinus" MouseUp="BorderBtnMinus_MouseUp" Background="{DynamicResource RandWindowButtonBackground}" Height="70" Width="70" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
@@ -51,8 +51,8 @@
|
||||
</Image>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
<TextBlock Name="LabelNumberCount" Text="1" FontFamily="Consolas" FontSize="55" Margin="10" Width="80" TextAlignment="Center"/>
|
||||
<Border x:Name="BorderBtnAdd" MouseUp="BorderBtnAdd_MouseUp" Background="#FBFBFD" Height="70" Width="70" CornerRadius="100">
|
||||
<TextBlock Name="LabelNumberCount" Text="1" FontFamily="Consolas" FontSize="55" Margin="10" Width="80" TextAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
<Border x:Name="BorderBtnAdd" MouseUp="BorderBtnAdd_MouseUp" Background="{DynamicResource RandWindowButtonBackground}" Height="70" Width="70" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
@@ -79,49 +79,51 @@
|
||||
<ui:SimpleStackPanel Visibility="Collapsed" Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
|
||||
<CheckBox x:Name="NoHotStudents" MinWidth="0"
|
||||
Content="不抽热门人选" IsThreeState="True"
|
||||
HorizontalAlignment="Center" />
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
<CheckBox x:Name="NoShengPiZi" MinWidth="0"
|
||||
Content="避开生僻字" IsThreeState="True"
|
||||
HorizontalAlignment="Center" />
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Visibility="Collapsed" Margin="0,0,0,8" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
|
||||
<ComboBox Name="ComboBoxRandMode"
|
||||
MinWidth="0"
|
||||
IsEditable="False"
|
||||
SelectedIndex="0"
|
||||
IsReadOnly="True">
|
||||
IsReadOnly="True"
|
||||
Foreground="{DynamicResource RandWindowTextForeground}">
|
||||
<ComboBoxItem>全都抽</ComboBoxItem>
|
||||
<ComboBoxItem>只抽男</ComboBoxItem>
|
||||
<ComboBoxItem>只抽女</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</ui:SimpleStackPanel>
|
||||
<Border x:Name="BorderBtnRand" MouseUp="BorderBtnRand_MouseUp" Background="#0066BF" Height="70" Width="200" CornerRadius="35">
|
||||
<Border x:Name="BorderBtnRand" MouseUp="BorderBtnRand_MouseUp" Background="{DynamicResource RandWindowPrimaryButtonBackground}" Height="70" Width="200" CornerRadius="35">
|
||||
<ui:SimpleStackPanel Margin="3,0" Spacing="20" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Viewbox Margin="0,20">
|
||||
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Contact" Foreground="White"/>
|
||||
</Viewbox>
|
||||
<TextBlock Text="开抽" Foreground="White" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="开抽" Foreground="{DynamicResource RandWindowPrimaryButtonForeground}" FontSize="32" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="8" Margin="0,16,0,0" HorizontalAlignment="Center">
|
||||
<ComboBox Name="ComboBoxCallerType" Width="120" Height="50" VerticalAlignment="Center"
|
||||
IsEditable="False" IsReadOnly="True" SelectedIndex="0">
|
||||
IsEditable="False" IsReadOnly="True" SelectedIndex="0"
|
||||
Foreground="{DynamicResource RandWindowTextForeground}">
|
||||
<ComboBoxItem>ClassIsland点名</ComboBoxItem>
|
||||
<ComboBoxItem>SecRandom点名</ComboBoxItem>
|
||||
<ComboBoxItem>NamePicker点名</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Border x:Name="BorderBtnExternalCaller" MouseUp="BorderBtnExternalCaller_MouseUp" Background="#00B894" Height="50" Width="120" CornerRadius="25">
|
||||
<Border x:Name="BorderBtnExternalCaller" MouseUp="BorderBtnExternalCaller_MouseUp" Background="{DynamicResource RandWindowSecondaryButtonBackground}" Height="50" Width="120" CornerRadius="25">
|
||||
<ui:SimpleStackPanel Margin="3,0" Spacing="8" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Viewbox Margin="0,10">
|
||||
<ui:SymbolIcon Symbol="Globe" Foreground="White"/>
|
||||
</Viewbox>
|
||||
<TextBlock Text="外部点名" Foreground="White" FontSize="16" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="外部点名" Foreground="{DynamicResource RandWindowSecondaryButtonForeground}" FontSize="16" Margin="-1,-1,4,0" VerticalAlignment="Center"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
</ui:SimpleStackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</Grid>
|
||||
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BorderBtnHelp" MouseUp="BorderBtnHelp_MouseUp" Background="#FBFBFD" Grid.Column="1" Margin="10,10,60,10" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" CornerRadius="20">
|
||||
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BorderBtnHelp" MouseUp="BorderBtnHelp_MouseUp" Background="{DynamicResource RandWindowButtonBackground}" Grid.Column="1" Margin="10,10,60,10" Height="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" CornerRadius="20">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
@@ -129,15 +131,15 @@
|
||||
<Viewbox Margin="15,12">
|
||||
<ui:SymbolIcon Symbol="People" Foreground="Black"/>
|
||||
</Viewbox>
|
||||
<TextBlock Margin="-5,12,15,12" Name="TextBlockPeopleCount" Text="点击此处以导入名单" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Margin="-5,12,15,12" Name="TextBlockPeopleCount" Text="点击此处以导入名单" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</Border>
|
||||
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="{Binding ElementName=BorderBtnHelp, Path=VerticalAlignment}" Margin="10" Grid.Column="1" Background="#E32A34" Height="40" Width="40" CornerRadius="100">
|
||||
<Border UseLayoutRounding="True" Canvas.Bottom="8" Canvas.Right="8" x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="{Binding ElementName=BorderBtnHelp, Path=VerticalAlignment}" Margin="10" Grid.Column="1" Background="{DynamicResource RandWindowCloseButtonBackground}" Height="40" Width="40" CornerRadius="100">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||
</Border.Effect>
|
||||
<Viewbox Margin="14">
|
||||
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
|
||||
<ui:SymbolIcon Symbol="Clear" Foreground="{DynamicResource RandWindowCloseButtonForeground}"/>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</Canvas>
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace Ink_Canvas
|
||||
// 加载背景
|
||||
LoadBackground(settings);
|
||||
|
||||
// 应用主题
|
||||
ApplyTheme(settings);
|
||||
|
||||
// 设置窗口为置顶
|
||||
Topmost = true;
|
||||
|
||||
@@ -75,6 +78,27 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyTheme(Settings settings)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 根据主题设置窗口背景
|
||||
if (settings.RandSettings.SelectedBackgroundIndex <= 0)
|
||||
{
|
||||
// 没有自定义背景时,使用主题背景色
|
||||
var backgroundBrush = Application.Current.FindResource("RandWindowBackground") as SolidColorBrush;
|
||||
if (backgroundBrush != null)
|
||||
{
|
||||
MainBorder.Background = backgroundBrush;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用点名窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public RandWindow(Settings settings, bool IsAutoClose)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -88,6 +112,9 @@ namespace Ink_Canvas
|
||||
// 加载背景
|
||||
LoadBackground(settings);
|
||||
|
||||
// 应用主题
|
||||
ApplyTheme(settings);
|
||||
|
||||
// 设置窗口为置顶
|
||||
Topmost = true;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
|
||||
Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
|
||||
Title="Ink Canvas 画板 - 计时器" Height="400" Width="600">
|
||||
<Border Background="White" CornerRadius="15" BorderThickness="1" BorderBrush="#E0E0E0" Margin="10">
|
||||
<Border Background="{DynamicResource SeewoTimerWindowBackground}" CornerRadius="15" BorderThickness="1" BorderBrush="{DynamicResource SeewoTimerWindowBorderBrush}" Margin="10">
|
||||
<Grid>
|
||||
<!-- 主要内容区域 -->
|
||||
<Grid>
|
||||
@@ -17,17 +17,17 @@
|
||||
<Viewbox x:Name="MainViewController" Margin="20,20,20,20">
|
||||
<Grid Height="350" Width="600">
|
||||
<!-- 顶部标题栏 -->
|
||||
<Grid Height="50" Background="White" x:Name="TitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top">
|
||||
<Grid Height="50" Background="{DynamicResource SeewoTimerWindowBackground}" x:Name="TitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top">
|
||||
<TextBlock Text="计时" FontSize="20" FontWeight="Bold"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||
Margin="22,0,0,0" Foreground="#333333" x:Name="TitleText"/>
|
||||
Margin="22,0,0,0" Foreground="{DynamicResource SeewoTimerWindowTitleForeground}" x:Name="TitleText"/>
|
||||
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,22,0" Background="#F5F5F5" Height="30" Width="30"
|
||||
Margin="0,0,22,0" Background="{DynamicResource SeewoTimerWindowButtonBackground}" Height="30" Width="30"
|
||||
CornerRadius="15" Cursor="Hand">
|
||||
<TextBlock Text="×" FontSize="16" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="#666666"/>
|
||||
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!-- 6位数字显示区域 -->
|
||||
@@ -43,7 +43,7 @@
|
||||
<Grid Margin="0,0,15,0">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit1PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit1PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit1Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -52,13 +52,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit1Display" Text="0" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit1MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit1MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit1Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -67,7 +67,7 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -76,7 +76,7 @@
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit2PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit2PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit2Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -85,13 +85,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit2Display" Text="0" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit2MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit2MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit2Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -100,14 +100,14 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- 时标签 -->
|
||||
<TextBlock Text="时" FontSize="16" HorizontalAlignment="Center"
|
||||
Foreground="#666666" Margin="0,112,0,-13"/>
|
||||
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-13"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 分钟组(十位和个位) -->
|
||||
@@ -117,7 +117,7 @@
|
||||
<Grid Margin="0,0,15,0">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit3PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit3PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit3Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -126,13 +126,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit3Display" Text="0" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit3MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit3MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit3Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -141,7 +141,7 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -150,7 +150,7 @@
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit4PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit4PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit4Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -159,13 +159,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit4Display" Text="5" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit4MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit4MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit4Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -174,14 +174,14 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- 分标签 -->
|
||||
<TextBlock Text="分" FontSize="16" HorizontalAlignment="Center"
|
||||
Foreground="#666666" Margin="0,112,0,-12"/>
|
||||
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 秒组(十位和个位) -->
|
||||
@@ -191,7 +191,7 @@
|
||||
<Grid Margin="0,0,15,0">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit5PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit5PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit5Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -200,13 +200,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit5Display" Text="0" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit5MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit5MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit5Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -215,7 +215,7 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -224,7 +224,7 @@
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 上方+按钮 -->
|
||||
<Button x:Name="Digit6PlusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit6PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit6Plus_Click" Cursor="Hand" Margin="0,0,0,8">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -233,13 +233,13 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<!-- 数字显示 -->
|
||||
<TextBlock x:Name="Digit6Display" Text="0" FontSize="64" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
|
||||
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
|
||||
<!-- 下方-按钮 -->
|
||||
<Button x:Name="Digit6MinusBtn" Width="40" Height="40" Background="#F0F0F0"
|
||||
<Button x:Name="Digit6MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Digit6Minus_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -248,14 +248,14 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
|
||||
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<!-- 秒标签 -->
|
||||
<TextBlock Text="秒" FontSize="16" HorizontalAlignment="Center"
|
||||
Foreground="#666666" Margin="0,112,0,-12"/>
|
||||
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<!-- 全屏按钮 -->
|
||||
<Button x:Name="FullscreenBtn" Width="80" Height="40" Background="#F5F5F5"
|
||||
<Button x:Name="FullscreenBtn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Fullscreen_Click" Cursor="Hand" Margin="0,0,30,0">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -275,13 +275,13 @@
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="⛶" FontSize="16" Foreground="#666666" Margin="0,0,5,0"/>
|
||||
<TextBlock Text="全屏" FontSize="12" Foreground="#666666"/>
|
||||
<TextBlock Text="⛶" FontSize="16" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,0,5,0"/>
|
||||
<TextBlock Text="全屏" FontSize="12" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<!-- 开始/暂停按钮 -->
|
||||
<Button x:Name="StartPauseBtn" Width="80" Height="80" Background="#4CAF50"
|
||||
<Button x:Name="StartPauseBtn" Width="80" Height="80" Background="{DynamicResource SeewoTimerWindowPrimaryButtonBackground}"
|
||||
BorderThickness="0" Click="StartPause_Click" Cursor="Hand" Margin="0,0,30,0">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -290,12 +290,12 @@
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock x:Name="StartPauseIcon" Text="▶" FontSize="32" Foreground="White"
|
||||
<TextBlock x:Name="StartPauseIcon" Text="▶" FontSize="32" Foreground="{DynamicResource SeewoTimerWindowPrimaryButtonForeground}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Button>
|
||||
|
||||
<!-- 重置按钮 -->
|
||||
<Button x:Name="ResetBtn" Width="80" Height="40" Background="#F5F5F5"
|
||||
<Button x:Name="ResetBtn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
|
||||
BorderThickness="0" Click="Reset_Click" Cursor="Hand">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
@@ -305,8 +305,8 @@
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock Text="↻" FontSize="16" Foreground="#666666" Margin="0,0,5,0"/>
|
||||
<TextBlock Text="重置" FontSize="12" Foreground="#666666"/>
|
||||
<TextBlock Text="↻" FontSize="16" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,0,5,0"/>
|
||||
<TextBlock Text="重置" FontSize="12" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
@@ -23,6 +23,9 @@ namespace Ink_Canvas
|
||||
timer.Elapsed += Timer_Elapsed;
|
||||
timer.Interval = 50;
|
||||
InitializeUI();
|
||||
|
||||
// 应用主题
|
||||
ApplyTheme();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +87,28 @@ namespace Ink_Canvas
|
||||
UpdateDigitDisplays();
|
||||
}
|
||||
|
||||
private void ApplyTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 根据主题设置数字显示颜色
|
||||
var digitForeground = Application.Current.FindResource("SeewoTimerWindowDigitForeground") as SolidColorBrush;
|
||||
if (digitForeground != null)
|
||||
{
|
||||
Digit1Display.Foreground = digitForeground;
|
||||
Digit2Display.Foreground = digitForeground;
|
||||
Digit3Display.Foreground = digitForeground;
|
||||
Digit4Display.Foreground = digitForeground;
|
||||
Digit5Display.Foreground = digitForeground;
|
||||
Digit6Display.Foreground = digitForeground;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用仿希沃倒计时窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDigitDisplays()
|
||||
{
|
||||
Digit1Display.Text = (hour / 10).ToString();
|
||||
|
||||
Reference in New Issue
Block a user