Merge pull request #270 from InkCanvasForClass/beta

ICC CE 1.7.16.0
This commit is contained in:
CJK_mkp
2025-10-26 00:26:52 +08:00
committed by GitHub
21 changed files with 3072 additions and 23 deletions
+1 -1
View File
@@ -1 +1 @@
1.7.15.0
1.7.16.0
+2 -2
View File
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.15.0")]
[assembly: AssemblyFileVersion("1.7.15.0")]
[assembly: AssemblyVersion("1.7.16.0")]
[assembly: AssemblyFileVersion("1.7.16.0")]
@@ -0,0 +1,35 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace Ink_Canvas.Converters
{
/// <summary>
/// 位置计算转换器
/// </summary>
public class PositionConverters
{
/// <summary>
/// 减法转换器
/// </summary>
public class SubtractConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double baseValue && parameter is string paramStr)
{
if (double.TryParse(paramStr, out double subtractValue))
{
return baseValue - subtractValue;
}
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
}
+65
View File
@@ -3249,6 +3249,15 @@
FontWeight="Bold"
Toggled="ToggleSwitchShowRandomAndSingleDraw_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用快抽悬浮按钮"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchEnableQuickDraw"
IsOn="True" FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
Toggled="ToggleSwitchEnableQuickDraw_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="直接调用外部点名"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
@@ -3299,6 +3308,62 @@
FontFamily="Consolas"
Text="{Binding ElementName=RandWindowOnceMaxStudentsSlider, Path=Value, Converter={StaticResource IntNumberToString}}" />
</ui:SimpleStackPanel>
<!-- 新点名UI设置 -->
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<TextBlock Foreground="#fafafa" Text="新点名UI设置"
FontSize="16" FontWeight="Bold" Margin="0,10,0,5" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用新点名UI"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchUseNewRollCallUI"
IsOn="True" FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
Toggled="ToggleSwitchUseNewRollCallUI_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用机器学习避免重复"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchEnableMLAvoidance"
IsOn="True" FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
Toggled="ToggleSwitchEnableMLAvoidance_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="避免重复历史记录数量" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider x:Name="MLAvoidanceHistorySlider" Minimum="5"
Maximum="50" Width="168" FontFamily="Microsoft YaHei UI"
ValueChanged="MLAvoidanceHistorySlider_ValueChanged"
FontSize="20" IsSnapToTickEnabled="True" Value="20" TickFrequency="5"
TickPlacement="None" AutoToolTipPlacement="None" />
<TextBlock VerticalAlignment="Center" Margin="12,0,16,0" FontSize="14"
FontFamily="Consolas"
Text="{Binding ElementName=MLAvoidanceHistorySlider, Path=Value, Converter={StaticResource IntNumberToString}}" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="避免重复权重" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider x:Name="MLAvoidanceWeightSlider" Minimum="0.1"
Maximum="1.0" Width="168" FontFamily="Microsoft YaHei UI"
ValueChanged="MLAvoidanceWeightSlider_ValueChanged"
FontSize="20" IsSnapToTickEnabled="True" Value="0.8" TickFrequency="0.1"
TickPlacement="None" AutoToolTipPlacement="None" />
<TextBlock VerticalAlignment="Center" Margin="12,0,16,0" FontSize="14"
FontFamily="Consolas"
Text="{Binding ElementName=MLAvoidanceWeightSlider, Path=Value, StringFormat={}{0:P0}}" />
</ui:SimpleStackPanel>
<TextBlock Text="# 机器学习算法会分析最近的点名历史,智能避免重复选择相同人员"
TextWrapping="Wrap" Foreground="#a1a1aa" Margin="0,5,0,0" />
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<TextBlock Foreground="#fafafa" Text="计时器设置"
+61 -1
View File
@@ -60,6 +60,9 @@ namespace Ink_Canvas
// 悬浮窗拦截管理器
private FloatingWindowInterceptorManager _floatingWindowInterceptorManager;
// 快抽悬浮按钮
private QuickDrawFloatingButton _quickDrawFloatingButton;
// 设置面板相关状态
private bool userChangedNoFocusModeInSettings;
private bool isTemporarilyDisablingNoFocusMode = false;
@@ -530,6 +533,9 @@ namespace Ink_Canvas
else
RadioCrashNoAction.IsChecked = true;
// 显示快抽悬浮按钮
ShowQuickDrawFloatingButton();
// 如果当前不是黑板模式,则切换到黑板模式
if (currentMode == 0)
{
@@ -668,6 +674,19 @@ namespace Ink_Canvas
private void Window_Closing(object sender, CancelEventArgs e)
{
LogHelper.WriteLogToFile("Ink Canvas closing", LogHelper.LogType.Event);
try
{
if (_quickDrawFloatingButton != null)
{
_quickDrawFloatingButton.Close();
_quickDrawFloatingButton = null;
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"关闭快抽悬浮按钮时出错: {ex.Message}", LogHelper.LogType.Error);
}
if (!CloseIsFromButton && Settings.Advanced.IsSecondConfirmWhenShutdownApp)
{
// 第一个确认对话框
@@ -2509,7 +2528,9 @@ namespace Ink_Canvas
BoardHighlighterWidthSlider,
InkWidthSlider,
InkAlphaSlider,
HighlighterWidthSlider
HighlighterWidthSlider,
MLAvoidanceHistorySlider,
MLAvoidanceWeightSlider
};
foreach (var slider in sliders)
@@ -3053,6 +3074,45 @@ namespace Ink_Canvas
}
}
/// <summary>
/// 显示快抽悬浮按钮
/// </summary>
private void ShowQuickDrawFloatingButton()
{
try
{
// 检查设置是否启用快抽功能
if (Settings?.RandSettings?.EnableQuickDraw != true)
{
// 如果设置未启用,确保悬浮按钮被关闭
if (_quickDrawFloatingButton != null)
{
_quickDrawFloatingButton.Close();
_quickDrawFloatingButton = null;
}
return;
}
// 如果已经存在悬浮按钮,先关闭它
if (_quickDrawFloatingButton != null)
{
_quickDrawFloatingButton.Close();
_quickDrawFloatingButton = null;
}
// 创建并显示悬浮按钮
_quickDrawFloatingButton = new QuickDrawFloatingButton();
_quickDrawFloatingButton.Show();
LogHelper.WriteLogToFile("快抽悬浮按钮已显示", LogHelper.LogType.Trace);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"显示快抽悬浮按钮失败: {ex.Message}", LogHelper.LogType.Error);
}
}
#endregion
}
}
@@ -1085,11 +1085,20 @@ namespace Ink_Canvas
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardImageOptionsPanel);
var randWindow = new RandWindow(Settings);
randWindow.Show();
// 根据设置决定使用哪个点名窗口
if (Settings.RandSettings.UseNewRollCallUI)
{
// 使用新点名UI - 随机抽模式
new NewStyleRollCallWindow(Settings, false).ShowDialog();
}
else
{
// 使用默认的随机点名窗口
var randWindow = new RandWindow(Settings);
randWindow.Show();
// 使用延迟确保窗口完全显示后再强制置顶
randWindow.Dispatcher.BeginInvoke(new Action(() =>
// 使用延迟确保窗口完全显示后再强制置顶
randWindow.Dispatcher.BeginInvoke(new Action(() =>
{
try
{
@@ -1126,6 +1135,7 @@ namespace Ink_Canvas
LogHelper.WriteLogToFile($"强制置顶RandWindow失败: {ex.Message}", LogHelper.LogType.Error);
}
}), DispatcherPriority.Loaded);
}
}
public void CheckEraserTypeTab()
@@ -1232,14 +1242,30 @@ namespace Ink_Canvas
{
MessageBox.Show("无法调用外部点名:" + ex.Message);
// 调用失败时回退到默认的随机点名窗口
new RandWindow(Settings, true).ShowDialog();
// 调用失败时回退到相应的点名窗口
if (Settings.RandSettings.UseNewRollCallUI)
{
new NewStyleRollCallWindow(Settings, true).ShowDialog(); // 单次抽模式
}
else
{
new RandWindow(Settings, true).ShowDialog();
}
}
}
else
{
// 使用默认的随机点名窗口
new RandWindow(Settings, true).ShowDialog();
// 根据设置决定使用哪个点名窗口
if (Settings.RandSettings.UseNewRollCallUI)
{
// 使用新点名UI - 单次抽模式
new NewStyleRollCallWindow(Settings, true).ShowDialog();
}
else
{
// 使用默认的随机点名窗口
new RandWindow(Settings, true).ShowDialog();
}
}
}
+43
View File
@@ -2671,6 +2671,35 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
// 新点名UI设置事件处理
private void ToggleSwitchUseNewRollCallUI_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.UseNewRollCallUI = ToggleSwitchUseNewRollCallUI.IsOn;
SaveSettingsToFile();
}
private void ToggleSwitchEnableMLAvoidance_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.EnableMLAvoidance = ToggleSwitchEnableMLAvoidance.IsOn;
SaveSettingsToFile();
}
private void MLAvoidanceHistorySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!isLoaded) return;
Settings.RandSettings.MLAvoidanceHistoryCount = (int)MLAvoidanceHistorySlider.Value;
SaveSettingsToFile();
}
private void MLAvoidanceWeightSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!isLoaded) return;
Settings.RandSettings.MLAvoidanceWeight = MLAvoidanceWeightSlider.Value;
SaveSettingsToFile();
}
private void ProgressiveReminderVolumeSlider_ValueChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@@ -2740,6 +2769,20 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ToggleSwitchEnableQuickDraw_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
// 获取开关状态并保存到设置中
Settings.RandSettings.EnableQuickDraw = ToggleSwitchEnableQuickDraw.IsOn;
// 保存设置到文件
SaveSettingsToFile();
// 根据设置状态显示或隐藏快抽悬浮按钮
ShowQuickDrawFloatingButton();
}
private void ToggleSwitchExternalCaller_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@@ -876,6 +876,7 @@ namespace Ink_Canvas
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
ToggleSwitchShowRandomAndSingleDraw.IsOn = Settings.RandSettings.ShowRandomAndSingleDraw;
ToggleSwitchEnableQuickDraw.IsOn = Settings.RandSettings.EnableQuickDraw;
ToggleSwitchExternalCaller.IsOn = Settings.RandSettings.DirectCallCiRand;
ComboBoxExternalCallerType.SelectedIndex = Settings.RandSettings.ExternalCallerType;
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
@@ -886,6 +887,12 @@ namespace Ink_Canvas
ToggleSwitchUseNewStyleUI.IsOn = Settings.RandSettings.UseNewStyleUI;
ToggleSwitchEnableOvertimeCountUp.IsOn = Settings.RandSettings.EnableOvertimeCountUp;
// 新点名UI设置
ToggleSwitchUseNewRollCallUI.IsOn = Settings.RandSettings.UseNewRollCallUI;
ToggleSwitchEnableMLAvoidance.IsOn = Settings.RandSettings.EnableMLAvoidance;
MLAvoidanceHistorySlider.Value = Settings.RandSettings.MLAvoidanceHistoryCount;
MLAvoidanceWeightSlider.Value = Settings.RandSettings.MLAvoidanceWeight;
bool canEnableRedText = Settings.RandSettings.EnableOvertimeCountUp && Settings.RandSettings.EnableOvertimeRedText;
ToggleSwitchEnableOvertimeRedText.IsOn = canEnableRedText;
if (!canEnableRedText)
@@ -915,6 +922,7 @@ namespace Ink_Canvas
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
ToggleSwitchEnableQuickDraw.IsOn = Settings.RandSettings.EnableQuickDraw;
ToggleSwitchExternalCaller.IsOn = Settings.RandSettings.DirectCallCiRand;
ComboBoxExternalCallerType.SelectedIndex = Settings.RandSettings.ExternalCallerType;
ToggleSwitchUseLegacyTimerUI.IsOn = Settings.RandSettings.UseLegacyTimerUI;
+2 -2
View File
@@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.15.0")]
[assembly: AssemblyFileVersion("1.7.15.0")]
[assembly: AssemblyVersion("1.7.16.0")]
[assembly: AssemblyFileVersion("1.7.16.0")]
@@ -0,0 +1,39 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- 新点名窗口主题资源 -->
<!-- 浅色主题资源 -->
<SolidColorBrush x:Key="NewRollCallWindowBackgroundLight" Color="#FFFFFF"/>
<SolidColorBrush x:Key="NewRollCallWindowBorderBrushLight" Color="#E4E4E7"/>
<SolidColorBrush x:Key="NewRollCallWindowTitleForegroundLight" Color="#18181B"/>
<SolidColorBrush x:Key="NewRollCallWindowDigitForegroundLight" Color="#18181B"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonBackgroundLight" Color="#F4F4F5"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonForegroundLight" Color="#18181B"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonBackgroundLight" Color="#4CAF50"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonForegroundLight" Color="#FFFFFF"/>
<SolidColorBrush x:Key="NewRollCallWindowSecondaryTextForegroundLight" Color="#71717A"/>
<!-- 深色主题资源 -->
<SolidColorBrush x:Key="NewRollCallWindowBackgroundDark" Color="#1f1f1f"/>
<SolidColorBrush x:Key="NewRollCallWindowBorderBrushDark" Color="#E0E0E0"/>
<SolidColorBrush x:Key="NewRollCallWindowTitleForegroundDark" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowDigitForegroundDark" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonBackgroundDark" Color="#2a2a2a"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonForegroundDark" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonBackgroundDark" Color="#4CAF50"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonForegroundDark" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowSecondaryTextForegroundDark" Color="#9ca3af"/>
<!-- 默认资源绑定 -->
<SolidColorBrush x:Key="NewRollCallWindowBackground" Color="#1f1f1f"/>
<SolidColorBrush x:Key="NewRollCallWindowBorderBrush" Color="#E0E0E0"/>
<SolidColorBrush x:Key="NewRollCallWindowTitleForeground" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowDigitForeground" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonBackground" Color="#2a2a2a"/>
<SolidColorBrush x:Key="NewRollCallWindowButtonForeground" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonBackground" Color="#4CAF50"/>
<SolidColorBrush x:Key="NewRollCallWindowPrimaryButtonForeground" Color="White"/>
<SolidColorBrush x:Key="NewRollCallWindowSecondaryTextForeground" Color="#9ca3af"/>
</ResourceDictionary>
+10
View File
@@ -650,6 +650,16 @@ namespace Ink_Canvas
public double ProgressiveReminderVolume { get; set; } = 1.0;
[JsonProperty("progressiveReminderSoundPath")]
public string ProgressiveReminderSoundPath { get; set; } = "";
[JsonProperty("useNewRollCallUI")]
public bool UseNewRollCallUI { get; set; } = true;
[JsonProperty("enableMLAvoidance")]
public bool EnableMLAvoidance { get; set; } = true;
[JsonProperty("mlAvoidanceHistoryCount")]
public int MLAvoidanceHistoryCount { get; set; } = 20;
[JsonProperty("mlAvoidanceWeight")]
public double MLAvoidanceWeight { get; set; } = 0.8;
[JsonProperty("enableQuickDraw")]
public bool EnableQuickDraw { get; set; } = true;
}
public class CustomPickNameBackground
+2 -2
View File
@@ -88,8 +88,8 @@
<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="RandWindowButtonBackground" Color="#3F3F46"/>
<SolidColorBrush x:Key="RandWindowButtonForeground" Color="White"/>
<SolidColorBrush x:Key="RandWindowPrimaryButtonBackground" Color="#0066BF"/>
<SolidColorBrush x:Key="RandWindowPrimaryButtonForeground" Color="White"/>
<SolidColorBrush x:Key="RandWindowSecondaryButtonBackground" Color="#00B894"/>
+32 -7
View File
@@ -5,15 +5,40 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Ink_Canvas"
mc:Ignorable="d" FontFamily="Microsoft YaHei UI" ui:WindowHelper.UseModernWindowStyle="True"
ui:ThemeManager.RequestedTheme="Light" WindowStartupLocation="CenterScreen"
WindowStartupLocation="CenterScreen"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" Topmost="True"
Title="Ink Canvas 抽奖 - 名单导入" Height="500" Width="400"
Loaded="Window_Loaded" Closing="Window_Closing">
<Grid>
<Label Content="请在下方输入名单,每行一人(建议直接粘贴表格姓名列)" Margin="10"/>
<TextBox Name="TextBoxNames" FontFamily="Microsoft YaHei UI" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" Margin="10,40,10,50" />
<Button Margin="10" VerticalAlignment="Bottom" HorizontalAlignment="Right"
Content="关闭" FontFamily="Microsoft YaHei UI"
Width="100" Click="Button_Click"/>
<Window.Resources>
<!-- 主题资源 -->
<SolidColorBrush x:Key="NamesInputWindowBackground" Color="White"/>
<SolidColorBrush x:Key="NamesInputWindowForeground" Color="Black"/>
<SolidColorBrush x:Key="NamesInputWindowButtonBackground" Color="#F4F4F5"/>
<SolidColorBrush x:Key="NamesInputWindowButtonForeground" Color="Black"/>
<SolidColorBrush x:Key="NamesInputWindowBorderBrush" Color="#E4E4E7"/>
</Window.Resources>
<Grid Background="{DynamicResource NamesInputWindowBackground}">
<Label Content="请在下方输入名单,每行一人(建议直接粘贴表格姓名列)"
Margin="10"
Foreground="{DynamicResource NamesInputWindowForeground}"
FontFamily="Microsoft YaHei UI"/>
<TextBox Name="TextBoxNames"
FontFamily="Microsoft YaHei UI"
VerticalScrollBarVisibility="Auto"
AcceptsReturn="True"
Margin="10,40,10,50"
Background="{DynamicResource NamesInputWindowBackground}"
Foreground="{DynamicResource NamesInputWindowForeground}"
BorderBrush="{DynamicResource NamesInputWindowBorderBrush}"/>
<Button Margin="10"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
Content="关闭"
FontFamily="Microsoft YaHei UI"
Width="100"
Click="Button_Click"
Background="{DynamicResource NamesInputWindowButtonBackground}"
Foreground="{DynamicResource NamesInputWindowButtonForeground}"
BorderBrush="{DynamicResource NamesInputWindowBorderBrush}"/>
</Grid>
</Window>
+110
View File
@@ -1,7 +1,10 @@
using Ink_Canvas.Helpers;
using System;
using System.ComponentModel;
using System.IO;
using System.Windows;
using System.Windows.Media;
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
namespace Ink_Canvas
{
@@ -14,6 +17,7 @@ namespace Ink_Canvas
{
InitializeComponent();
AnimationsHelper.ShowWithSlideFromBottomAndFade(this, 0.25);
ApplyTheme();
}
string originText = "";
@@ -43,5 +47,111 @@ namespace Ink_Canvas
{
Close();
}
private void ApplyTheme()
{
try
{
if (MainWindow.Settings != null)
{
ApplyTheme(MainWindow.Settings);
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用名单导入窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
}
}
private void ApplyTheme(Settings settings)
{
try
{
if (settings.Appearance.Theme == 0) // 浅色主题
{
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, iNKORE.UI.WPF.Modern.ElementTheme.Light);
ApplyThemeResources("Light");
}
else if (settings.Appearance.Theme == 1) // 深色主题
{
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, iNKORE.UI.WPF.Modern.ElementTheme.Dark);
ApplyThemeResources("Dark");
}
else // 跟随系统主题
{
bool isSystemLight = IsSystemThemeLight();
if (isSystemLight)
{
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, iNKORE.UI.WPF.Modern.ElementTheme.Light);
ApplyThemeResources("Light");
}
else
{
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, iNKORE.UI.WPF.Modern.ElementTheme.Dark);
ApplyThemeResources("Dark");
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用名单导入窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
}
}
private void ApplyThemeResources(string theme)
{
try
{
var resources = this.Resources;
if (theme == "Light")
{
// 应用浅色主题资源
resources["NamesInputWindowBackground"] = new SolidColorBrush(Color.FromRgb(255, 255, 255));
resources["NamesInputWindowForeground"] = new SolidColorBrush(Color.FromRgb(24, 24, 27));
resources["NamesInputWindowButtonBackground"] = new SolidColorBrush(Color.FromRgb(244, 244, 245));
resources["NamesInputWindowButtonForeground"] = new SolidColorBrush(Color.FromRgb(24, 24, 27));
resources["NamesInputWindowBorderBrush"] = new SolidColorBrush(Color.FromRgb(228, 228, 231));
}
else
{
// 应用深色主题资源 - 与新计时器窗口统一
resources["NamesInputWindowBackground"] = new SolidColorBrush(Color.FromRgb(31, 31, 31)); // #1f1f1f
resources["NamesInputWindowForeground"] = new SolidColorBrush(Colors.White);
resources["NamesInputWindowButtonBackground"] = new SolidColorBrush(Color.FromRgb(42, 42, 42)); // #2a2a2a
resources["NamesInputWindowButtonForeground"] = new SolidColorBrush(Colors.White);
resources["NamesInputWindowBorderBrush"] = new SolidColorBrush(Color.FromRgb(224, 224, 224)); // #E0E0E0
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用名单导入窗口主题资源出错: {ex.Message}", LogHelper.LogType.Error);
}
}
private bool IsSystemThemeLight()
{
var light = false;
try
{
var registryKey = Microsoft.Win32.Registry.CurrentUser;
var themeKey = registryKey.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
if (themeKey != null)
{
var value = themeKey.GetValue("AppsUseLightTheme");
if (value != null)
{
light = (int)value == 1;
}
themeKey.Close();
}
}
catch
{
// 如果无法读取注册表,默认使用浅色主题
light = true;
}
return light;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,509 @@
<Window x:Class="Ink_Canvas.NewStyleRollCallWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Ink_Canvas"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:controls="clr-namespace:Ink_Canvas.Windows.Controls"
Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
Loaded="RollCallWindow_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
MouseMove="Window_MouseMove" MouseEnter="Window_MouseEnter"
Title="Ink Canvas 画板 - 点名" Height="500" Width="800">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Controls/WinUI3CloseButton.xaml" />
<ResourceDictionary Source="../Resources/NewRollCallWindowResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Border Background="{DynamicResource NewRollCallWindowBackground}" CornerRadius="15" BorderThickness="1" BorderBrush="{DynamicResource NewRollCallWindowBorderBrush}" Margin="10" x:Name="MainBorder" MouseLeftButtonDown="WindowDragMove">
<Grid>
<controls:WinUI3CloseButton x:Name="CloseButton"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,0,0,0" Cursor="Hand" Click="CloseButton_Click"
Content="✕"/>
<!-- 主要内容区域 -->
<Grid>
<!-- 使用Viewbox自动缩放内容 -->
<Viewbox x:Name="MainViewController" Margin="20,20,20,20">
<Grid Height="550" Width="1000">
<!-- 顶部标题栏 -->
<Grid Height="50" Background="{DynamicResource NewRollCallWindowBackground}" x:Name="TitleBar" VerticalAlignment="Top" MouseLeftButtonDown="WindowDragMove" Margin="0,0,450,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="22,0,0,0">
<!-- 点名图标 -->
<Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
StrokeLineJoin="Round"
Fill="Transparent"
Width="24" Height="24"
Stretch="Uniform"
Margin="0,0,8,0"/>
<!-- 点名文字 -->
<TextBlock Text="点名" FontSize="28" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowTitleForeground}" x:Name="TitleText"/>
</StackPanel>
</Grid>
<!-- 主要内容区域 - 分为左右两部分 -->
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center"
x:Name="MainContentGrid" Margin="0,-25,0,25">
<!-- 左侧:结果显示区域 -->
<Grid HorizontalAlignment="Left" VerticalAlignment="Center"
x:Name="MainDisplayGrid" Width="500" Margin="-10,0,0,0">
<!-- 结果显示区域 -->
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<!-- 主结果显示 -->
<TextBlock x:Name="MainResultDisplay" Text="点击开始点名" FontSize="48" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,0,20"/>
<!-- 多结果显示区域 - 支持最多20个结果 -->
<ScrollViewer x:Name="MultiResultScrollViewer" MaxHeight="200" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled" Visibility="Collapsed">
<StackPanel x:Name="MultiResultPanel" Orientation="Vertical" HorizontalAlignment="Center">
<!-- 第1行:结果1-5 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
<TextBlock x:Name="Result1Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result2Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result3Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result4Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result5Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Width="60"/>
</StackPanel>
<!-- 第2行:结果6-10 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
<TextBlock x:Name="Result6Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result7Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result8Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result9Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result10Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Width="60"/>
</StackPanel>
<!-- 第3行:结果11-15 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
<TextBlock x:Name="Result11Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result12Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result13Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result14Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result15Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Width="60"/>
</StackPanel>
<!-- 第4行:结果16-20 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock x:Name="Result16Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result17Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result18Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result19Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
<TextBlock x:Name="Result20Display" Text="" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
TextAlignment="Center" Width="60"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
<!-- 点名状态显示 -->
<TextBlock x:Name="StatusDisplay" Text="准备就绪" FontSize="16"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowSecondaryTextForeground}"
TextAlignment="Center" Margin="0,10,0,0"/>
</StackPanel>
</Grid>
<!-- 分割线 -->
<Border Width="2" Background="{DynamicResource NewRollCallWindowButtonForeground}"
Opacity="0.3" HorizontalAlignment="Left" VerticalAlignment="Stretch"
Margin="500,0,0,0"/>
<!-- 右侧:控制选项区域 -->
<Grid HorizontalAlignment="Left" VerticalAlignment="Center"
x:Name="ControlOptionsGrid" Width="450" Margin="520,0,0,0" Height="400">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 人数控制区域 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="点名人数" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
HorizontalAlignment="Center" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="CountMinusBtn" Width="40" Height="40" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="CountMinus_Click" Cursor="Hand" Margin="0,0,15,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="15">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Path Data="M5 12l14 0"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
StrokeLineJoin="Round"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"/>
</Button>
<TextBlock x:Name="CountDisplay" Text="1" FontSize="24" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
Width="60" TextAlignment="Center"/>
<Button x:Name="CountPlusBtn" Width="40" Height="40" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="CountPlus_Click" Cursor="Hand" Margin="15,0,0,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="15">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Path Data="M12 5l0 14 M5 12l14 0"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
StrokeLineJoin="Round"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<!-- 点名模式选择 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="点名模式" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
HorizontalAlignment="Center" Margin="0,0,0,10"/>
<Border Background="{DynamicResource NewRollCallWindowButtonBackground}"
CornerRadius="8"
BorderThickness="1"
BorderBrush="#616161"
Width="300" Height="40">
<Grid>
<!-- 背景指示器 -->
<Border x:Name="SegmentedIndicator"
Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
CornerRadius="7.5,0,0,7.5"
Width="100" Height="38"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="0,0,0,0"/>
<!-- 按钮容器 -->
<Grid>
<Button x:Name="RandomModeBtn"
Width="100" Height="40"
Background="Transparent"
BorderThickness="0"
Click="RandomMode_Click"
Cursor="Hand"
HorizontalAlignment="Left">
<TextBlock x:Name="RandomModeText" Text="随机点名" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</Button>
<Button x:Name="SequentialModeBtn"
Width="100" Height="40"
Background="Transparent"
BorderThickness="0"
Click="SequentialMode_Click"
Cursor="Hand"
HorizontalAlignment="Center">
<TextBlock x:Name="SequentialModeText" Text="顺序点名" FontSize="16" FontWeight="Normal"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
</Button>
<Button x:Name="GroupModeBtn"
Width="100" Height="40"
Background="Transparent"
BorderThickness="0"
Click="GroupMode_Click"
Cursor="Hand"
HorizontalAlignment="Right">
<TextBlock x:Name="GroupModeText" Text="分组点名" FontSize="16" FontWeight="Normal"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
</Button>
</Grid>
</Grid>
</Border>
</StackPanel>
</Grid>
<!-- 外部点名区域 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="外部点名" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
HorizontalAlignment="Center" Margin="0,0,0,10"/>
<!-- 外部点名类型切换 -->
<Border Background="{DynamicResource NewRollCallWindowButtonBackground}"
CornerRadius="8"
BorderThickness="1"
BorderBrush="#616161"
Width="360" Height="40">
<Grid>
<!-- 背景指示器 -->
<Border x:Name="ExternalCallerIndicator"
Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
CornerRadius="7.5,0,0,7.5"
Width="120" Height="38"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="0,0,0,0"/>
<!-- 按钮容器 -->
<Grid>
<Button x:Name="ClassIslandBtn"
Width="120" Height="40"
Background="Transparent"
BorderThickness="0"
Click="ClassIsland_Click"
Cursor="Hand"
HorizontalAlignment="Left">
<TextBlock x:Name="ClassIslandText" Text="ClassIsland" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</Button>
<Button x:Name="SecRandomBtn"
Width="120" Height="40"
Background="Transparent"
BorderThickness="0"
Click="SecRandom_Click"
Cursor="Hand"
HorizontalAlignment="Center">
<TextBlock x:Name="SecRandomText" Text="SecRandom" FontSize="16" FontWeight="Normal"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
</Button>
<Button x:Name="NamePickerBtn"
Width="120" Height="40"
Background="Transparent"
BorderThickness="0"
Click="NamePicker_Click"
Cursor="Hand"
HorizontalAlignment="Right">
<TextBlock x:Name="NamePickerText" Text="NamePicker" FontSize="16" FontWeight="Normal"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
</Button>
</Grid>
</Grid>
</Border>
</StackPanel>
</Grid>
<!-- 名单管理区域 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="名单管理" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
HorizontalAlignment="Center" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="ImportListBtn" Width="90" Height="40" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="ImportList_Click" Cursor="Hand" Margin="0,0,10,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="导入名单" FontSize="14"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</Button>
<Button x:Name="ClearListBtn" Width="90" Height="40" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="ClearList_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="清空名单" FontSize="14"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<!-- 名单统计信息 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock x:Name="ListCountDisplay" Text="名单人数: 0" FontSize="14"
Foreground="{DynamicResource NewRollCallWindowSecondaryTextForeground}"
HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</Grid>
<!-- 底部控制按钮区域 -->
<Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!-- 外部点名按钮 -->
<Button x:Name="ExternalCallerBtn" Width="140" Height="60"
Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="ExternalCaller_Click" Cursor="Hand" Margin="0,0,20,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="30">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Path Data="M9 15L15 9 M11 6L11.463 5.464C12.4008 4.52633 13.6727 3.9996 14.9989 3.99969C16.325 3.99979 17.5968 4.52669 18.5345 5.4645C19.4722 6.40231 19.9989 7.67419 19.9988 9.00035C19.9987 10.3265 19.4718 11.5983 18.534 12.536L18 13 M13.0001 18L12.6031 18.534C11.6544 19.4722 10.3739 19.9984 9.03964 19.9984C7.70535 19.9984 6.42489 19.4722 5.47614 18.534C5.0085 18.0716 4.63724 17.521 4.38385 16.9141C4.13047 16.3073 4 15.6561 4 14.9985C4 14.3408 4.13047 13.6897 4.38385 13.0829C4.63724 12.476 5.0085 11.9254 5.47614 11.463L6.00014 11"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"
Margin="0,0,8,0"/>
<TextBlock Text="外部点名" FontSize="18" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</StackPanel>
</Button>
<!-- 开始点名按钮 -->
<Button x:Name="StartRollCallBtn" Width="140" Height="60" Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
BorderThickness="0" Click="StartRollCall_Click" Cursor="Hand" Margin="0,0,20,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="30">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15"
Stroke="{DynamicResource NewRollCallWindowPrimaryButtonForeground}"
StrokeThickness="2"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"
Margin="0,0,8,0"/>
<TextBlock Text="开始点名" FontSize="18" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowPrimaryButtonForeground}"/>
</StackPanel>
</Button>
<!-- 停止点名按钮 -->
<Button x:Name="StopRollCallBtn" Width="100" Height="60" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="StopRollCall_Click" Cursor="Hand" Margin="0,0,20,0" Visibility="Collapsed">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="30">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Path Data="M6 6l12 12 M18 6l-12 12"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
StrokeLineJoin="Round"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"
Margin="0,0,8,0"/>
<TextBlock Text="停止" FontSize="18" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</StackPanel>
</Button>
<!-- 重置按钮 -->
<Button x:Name="ResetBtn" Width="140" Height="60" Background="{DynamicResource NewRollCallWindowButtonBackground}"
BorderThickness="0" Click="Reset_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="30">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Path Data="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4 M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
StrokeThickness="2"
StrokeLineJoin="Round"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"
Margin="0,0,8,0"/>
<TextBlock Text="重置" FontSize="18" FontWeight="Bold"
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
</StackPanel>
</Button>
</StackPanel>
</Grid>
</Grid>
</Viewbox>
</Grid>
</Grid>
</Border>
</Window>
@@ -0,0 +1,125 @@
using Ink_Canvas.Helpers;
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Runtime.InteropServices;
using System.Windows.Threading;
namespace Ink_Canvas
{
/// <summary>
/// 快抽悬浮按钮
/// </summary>
public partial class QuickDrawFloatingButton : Window
{
public QuickDrawFloatingButton()
{
InitializeComponent();
// 设置无焦点状态
this.Focusable = false;
this.ShowInTaskbar = false;
}
private void FloatingButton_Loaded(object sender, RoutedEventArgs e)
{
// 设置位置到屏幕右下角稍微靠近中部
SetPositionToBottomRight();
// 应用置顶
ApplyFloatingButtonTopmost();
}
private void SetPositionToBottomRight()
{
try
{
// 获取主屏幕的工作区域
var workingArea = SystemParameters.WorkArea;
this.Left = workingArea.Right - this.Width - 0;
this.Top = workingArea.Bottom - this.Height - 200;
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"设置悬浮按钮位置失败: {ex.Message}", LogHelper.LogType.Error);
// 如果计算失败,使用默认位置
this.Left = 720;
this.Top = 400;
}
}
private void FloatingButton_Click(object sender, MouseButtonEventArgs e)
{
try
{
// 打开快抽窗口
var quickDrawWindow = new QuickDrawWindow();
quickDrawWindow.ShowDialog();
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"打开快抽窗口失败: {ex.Message}", LogHelper.LogType.Error);
}
}
#region Win32 API
[DllImport("user32.dll")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
private const int GWL_EXSTYLE = -20;
private const int WS_EX_TOPMOST = 0x00000008;
private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
private const uint SWP_NOMOVE = 0x0002;
private const uint SWP_NOSIZE = 0x0001;
private const uint SWP_NOACTIVATE = 0x0010;
private const uint SWP_SHOWWINDOW = 0x0040;
private const uint SWP_NOOWNERZORDER = 0x0200;
/// <summary>
/// 应用悬浮按钮置顶
/// </summary>
private void ApplyFloatingButtonTopmost()
{
try
{
var hwnd = new WindowInteropHelper(this).Handle;
if (hwnd == IntPtr.Zero) return;
// 强制激活窗口
Activate();
Focus();
// 设置WPF的Topmost属性
Topmost = true;
// 使用Win32 API强制置顶
// 1. 设置窗口样式为置顶
int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_TOPMOST);
// 2. 使用SetWindowPos确保窗口在最顶层
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
LogHelper.WriteLogToFile("快抽悬浮按钮已应用置顶", LogHelper.LogType.Trace);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用快抽悬浮按钮置顶失败: {ex.Message}", LogHelper.LogType.Error);
}
}
#endregion
}
}
@@ -0,0 +1,43 @@
<Window x:Class="Ink_Canvas.QuickDrawFloatingButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
Loaded="FloatingButton_Loaded" WindowStartupLocation="Manual"
ShowInTaskbar="False" Focusable="False"
Title="快抽悬浮按钮" Height="45" Width="45">
<Window.Resources>
<ResourceDictionary>
<!-- 悬浮按钮资源 -->
<SolidColorBrush x:Key="QuickDrawFloatingButtonBackground" Color="#80000000"/>
<SolidColorBrush x:Key="QuickDrawFloatingButtonBorderBrush" Color="#40000000"/>
<SolidColorBrush x:Key="QuickDrawFloatingButtonIconForeground" Color="White"/>
</ResourceDictionary>
</Window.Resources>
<Border Background="{DynamicResource QuickDrawFloatingButtonBackground}"
CornerRadius="8"
BorderThickness="1"
BorderBrush="{DynamicResource QuickDrawFloatingButtonBorderBrush}"
MouseLeftButtonDown="FloatingButton_Click"
Cursor="Hand">
<Border.Effect>
<DropShadowEffect Color="Black" Direction="315" ShadowDepth="3" Opacity="0.3" BlurRadius="5"/>
</Border.Effect>
<Grid>
<Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15"
Stroke="{DynamicResource QuickDrawFloatingButtonIconForeground}"
StrokeThickness="2"
StrokeLineJoin="Round"
Fill="Transparent"
Width="20" Height="20"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Border>
</Window>
+283
View File
@@ -0,0 +1,283 @@
using Ink_Canvas.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
using System.Runtime.InteropServices;
using Newtonsoft.Json;
using System.IO;
namespace Ink_Canvas
{
/// <summary>
/// 快抽窗口
/// </summary>
public partial class QuickDrawWindow : Window
{
private Random random = new Random();
private int autoCloseWaitTime = 2500; // 自动关闭等待时间(毫秒)
private List<string> nameList = new List<string>(); // 名单列表
public QuickDrawWindow()
{
InitializeComponent();
this.Focusable = false;
this.ShowInTaskbar = false;
InitializeSettings();
LoadNamesFromFile();
StartQuickDraw();
}
private void InitializeSettings()
{
try
{
if (MainWindow.Settings?.RandSettings != null)
{
autoCloseWaitTime = (int)MainWindow.Settings.RandSettings.RandWindowOnceCloseLatency * 1000;
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"初始化快抽窗口设置失败: {ex.Message}", LogHelper.LogType.Error);
}
}
private void LoadNamesFromFile()
{
try
{
string namesFilePath = App.RootPath + "Names.txt";
if (File.Exists(namesFilePath))
{
string content = File.ReadAllText(namesFilePath);
nameList = content.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)
.Select(name => name.Trim())
.Where(name => !string.IsNullOrEmpty(name))
.ToList();
}
else
{
nameList.Clear();
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"加载名单文件失败: {ex.Message}", LogHelper.LogType.Error);
nameList.Clear();
}
}
private void StartQuickDraw()
{
try
{
// 延迟100ms后开始抽选动画
new System.Threading.Thread(() =>
{
System.Threading.Thread.Sleep(100);
Application.Current.Dispatcher.Invoke(() =>
{
StartQuickDrawAnimation();
});
}).Start();
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"开始快抽失败: {ex.Message}", LogHelper.LogType.Error);
}
}
/// <summary>
/// 快抽动画
/// </summary>
private void StartQuickDrawAnimation()
{
const int animationTimes = 100; // 动画次数
const int sleepTime = 5; // 每次动画间隔(毫秒)
new System.Threading.Thread(() =>
{
if (nameList.Count > 0)
{
// 有名单时,从名单中抽选
StartNameDrawAnimation(animationTimes, sleepTime);
}
else
{
// 没有名单时,从1-60数字中抽选
StartNumberDrawAnimation(animationTimes, sleepTime);
}
}).Start();
}
/// <summary>
/// 名单抽选动画
/// </summary>
private void StartNameDrawAnimation(int animationTimes, int sleepTime)
{
List<string> usedNames = new List<string>();
for (int i = 0; i < animationTimes; i++)
{
// 随机选择一个名字进行动画显示,避免立即重复
string randomName;
do
{
randomName = nameList[random.Next(0, nameList.Count)];
} while (usedNames.Count > 0 && usedNames[usedNames.Count - 1] == randomName);
usedNames.Add(randomName);
Application.Current.Dispatcher.Invoke(() =>
{
MainResultDisplay.Text = randomName;
});
System.Threading.Thread.Sleep(sleepTime);
}
// 动画结束,显示最终结果
Application.Current.Dispatcher.Invoke(() =>
{
// 随机选择一个最终名字
string finalName = nameList[random.Next(0, nameList.Count)];
MainResultDisplay.Text = finalName;
});
// 显示结果后,等待一段时间让用户看到结果,然后关闭窗口
new System.Threading.Thread(() =>
{
System.Threading.Thread.Sleep(autoCloseWaitTime);
Application.Current.Dispatcher.Invoke(() =>
{
Close();
});
}).Start();
}
/// <summary>
/// 数字抽选动画
/// </summary>
private void StartNumberDrawAnimation(int animationTimes, int sleepTime)
{
List<int> usedNumbers = new List<int>();
for (int i = 0; i < animationTimes; i++)
{
// 随机选择一个数字进行动画显示,避免立即重复
int randomNumber;
do
{
randomNumber = random.Next(1, 61); // 1-60
} while (usedNumbers.Count > 0 && usedNumbers[usedNumbers.Count - 1] == randomNumber);
usedNumbers.Add(randomNumber);
Application.Current.Dispatcher.Invoke(() =>
{
MainResultDisplay.Text = randomNumber.ToString();
});
System.Threading.Thread.Sleep(sleepTime);
}
// 动画结束,显示最终结果
Application.Current.Dispatcher.Invoke(() =>
{
// 随机选择一个最终数字
int finalNumber = random.Next(1, 61);
MainResultDisplay.Text = finalNumber.ToString();
});
// 显示结果后,等待一段时间让用户看到结果,然后关闭窗口
new System.Threading.Thread(() =>
{
System.Threading.Thread.Sleep(autoCloseWaitTime);
Application.Current.Dispatcher.Invoke(() =>
{
Close();
});
}).Start();
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
// 窗口关闭时的清理工作
}
private void WindowDragMove(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
DragMove();
}
#region Win32 API
[DllImport("user32.dll")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
private const int GWL_EXSTYLE = -20;
private const int WS_EX_TOPMOST = 0x00000008;
private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
private const uint SWP_NOMOVE = 0x0002;
private const uint SWP_NOSIZE = 0x0001;
private const uint SWP_NOACTIVATE = 0x0010;
private const uint SWP_SHOWWINDOW = 0x0040;
private const uint SWP_NOOWNERZORDER = 0x0200;
/// <summary>
/// 应用快抽窗口置顶
/// </summary>
private void ApplyQuickDrawWindowTopmost()
{
try
{
var hwnd = new WindowInteropHelper(this).Handle;
if (hwnd == IntPtr.Zero) return;
// 设置WPF的Topmost属性
Topmost = true;
// 使用Win32 API强制置顶
// 1. 设置窗口样式为置顶
int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_TOPMOST);
// 2. 使用SetWindowPos确保窗口在最顶层
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
LogHelper.WriteLogToFile("快抽窗口已应用置顶", LogHelper.LogType.Trace);
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用快抽窗口置顶失败: {ex.Message}", LogHelper.LogType.Error);
}
}
/// <summary>
/// 窗口加载事件处理,确保置顶
/// </summary>
private void QuickDrawWindow_Loaded(object sender, RoutedEventArgs e)
{
// 使用延迟确保窗口完全加载后再应用置顶
Dispatcher.BeginInvoke(new Action(() =>
{
ApplyQuickDrawWindowTopmost();
}), DispatcherPriority.Loaded);
}
#endregion
}
}
+77
View File
@@ -0,0 +1,77 @@
<Window x:Class="Ink_Canvas.QuickDrawWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Ink_Canvas"
Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
Loaded="QuickDrawWindow_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
Title="快抽窗口" Height="200" Width="400" Focusable="False" ShowInTaskbar="False">
<Window.Resources>
<ResourceDictionary>
<!-- 快抽窗口资源 -->
<SolidColorBrush x:Key="QuickDrawWindowBackground" Color="#1f1f1f"/>
<SolidColorBrush x:Key="QuickDrawWindowBorderBrush" Color="#E0E0E0"/>
<SolidColorBrush x:Key="QuickDrawWindowTitleForeground" Color="White"/>
<SolidColorBrush x:Key="QuickDrawWindowDigitForeground" Color="White"/>
</ResourceDictionary>
</Window.Resources>
<Border Background="{DynamicResource QuickDrawWindowBackground}"
CornerRadius="15"
BorderThickness="1"
BorderBrush="{DynamicResource QuickDrawWindowBorderBrush}"
Margin="10"
x:Name="MainBorder"
MouseLeftButtonDown="WindowDragMove">
<Grid>
<!-- 主要内容区域 -->
<Grid>
<!-- 顶部标题栏 -->
<Grid Height="50" Background="{DynamicResource QuickDrawWindowBackground}"
x:Name="TitleBar"
VerticalAlignment="Top"
MouseLeftButtonDown="WindowDragMove"
Margin="10,8,40,0">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="22,0,0,0">
<!-- 快抽图标 -->
<Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15"
Stroke="{DynamicResource QuickDrawWindowTitleForeground}"
StrokeThickness="2"
StrokeLineJoin="Round"
Fill="Transparent"
Width="24" Height="24"
Stretch="Uniform"
Margin="0,0,8,0"/>
<!-- 快抽文字 -->
<TextBlock Text="快抽" FontSize="20" FontWeight="Bold"
Foreground="{DynamicResource QuickDrawWindowTitleForeground}"
x:Name="TitleText"/>
</StackPanel>
</Grid>
<!-- 主要内容区域 -->
<Grid Margin="20,60,20,20">
<!-- 结果显示区域 -->
<Grid x:Name="ResultGrid" HorizontalAlignment="Center" VerticalAlignment="Center">
<!-- 主结果显示 -->
<TextBlock x:Name="MainResultDisplay"
Text="准备抽选..."
FontSize="48"
FontWeight="Bold"
Foreground="{DynamicResource QuickDrawWindowDigitForeground}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextAlignment="Center"/>
</Grid>
</Grid>
</Grid>
</Grid>
</Border>
</Window>
+2
View File
@@ -100,3 +100,5 @@ ICC CE 1.7.X.X更新日志
99. 修复仅调色盘状态下浮动栏不居中
100. 修复希沃白板查杀与思锐希沃启动器导致的重复启动
101. 新增UIA窗口置顶
102. 新增新点名窗口
103. 新增点名快抽