Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c3938b652 | |||
| 16f80adb0d | |||
| 637b6bb4f9 | |||
| 12e91927a5 | |||
| 8f6f22ba7f | |||
| b520d6a334 | |||
| b7bff30445 | |||
| 0d790bbd80 | |||
| 8394e99127 | |||
| 16ae32bfd7 | |||
| cc6423e384 | |||
| 06cc587599 | |||
| 9d36088f1d | |||
| f9f73b015c | |||
| 77ffd696bb | |||
| bdb8bed053 | |||
| 4b17c8e96e | |||
| 8109711f4e | |||
| 327eba3fa7 | |||
| f3dccb2e99 | |||
| 7112d58e7c | |||
| 6e0aad853c | |||
| c64b1d0846 | |||
| 6eba16ce99 | |||
| 2f6f719843 | |||
| f34bac49e4 | |||
| 39cdc6231f | |||
| 745e24da70 | |||
| a4f4f4fb15 | |||
| 3833c229c6 | |||
| 3dc3e9b5a8 | |||
| 12eeb79e9f | |||
| e08c84f70d | |||
| 10f55d5b65 | |||
| 761992d089 | |||
| 991a823700 | |||
| 61dbcf762c | |||
| 60b0149a9c | |||
| 501c034cfa |
@@ -1 +1 @@
|
||||
1.7.15.0
|
||||
1.7.17.0
|
||||
|
||||
@@ -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.17.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.17.0")]
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\new-icons\gesture.png" />
|
||||
<Resource Include="Resources\new-icons\gesture_white.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\new-icons\gesture-enabled.png" />
|
||||
|
||||
+93
-10
@@ -2824,17 +2824,11 @@
|
||||
TextWrapping="Wrap" Foreground="#a1a1aa" Margin="0,0,0,8" />
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8">
|
||||
<Button Name="BtnUnregisterFileAssociation" Content="取消文件关联"
|
||||
Padding="12,6" Margin="0,0,8,0" Click="BtnUnregisterFileAssociation_Click"
|
||||
Background="#FFDC3545" Foreground="White" BorderBrush="#FFBD2130"
|
||||
FontFamily="Microsoft YaHei UI" FontSize="12" />
|
||||
Padding="15,5" Margin="0,0,8,0" Click="BtnUnregisterFileAssociation_Click" />
|
||||
<Button Name="BtnCheckFileAssociation" Content="检查关联状态"
|
||||
Padding="12,6" Margin="0,0,8,0" Click="BtnCheckFileAssociation_Click"
|
||||
Background="#FF17A2B8" Foreground="White" BorderBrush="#FF138496"
|
||||
FontFamily="Microsoft YaHei UI" FontSize="12" />
|
||||
Padding="15,5" Margin="0,0,8,0" Click="BtnCheckFileAssociation_Click" />
|
||||
<Button Name="BtnRegisterFileAssociation" Content="重新注册关联"
|
||||
Padding="12,6" Click="BtnRegisterFileAssociation_Click"
|
||||
Background="#FF28A745" Foreground="White" BorderBrush="#FF1E7E34"
|
||||
FontFamily="Microsoft YaHei UI" FontSize="12" />
|
||||
Padding="15,5" Click="BtnRegisterFileAssociation_Click" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Name="TextBlockFileAssociationStatus" Text=""
|
||||
Foreground="#a1a1aa" FontSize="12" Margin="0,4,0,0" />
|
||||
@@ -3083,6 +3077,30 @@
|
||||
Toggled="ToggleSwitchAutoSaveStrokesAtScreenshot_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="ToggleSwitchEnableAutoSaveStrokes" IsOn="False"
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchEnableAutoSaveStrokes_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#a1a1aa" Text="保存间隔" VerticalAlignment="Center"
|
||||
FontSize="12" Margin="0,0,16,0" />
|
||||
<ComboBox Name="ComboBoxAutoSaveStrokesInterval" Width="120"
|
||||
SelectionChanged="ComboBoxAutoSaveStrokesInterval_SelectionChanged">
|
||||
<ComboBoxItem Content="1分钟" Tag="1" />
|
||||
<ComboBoxItem Content="3分钟" Tag="3" />
|
||||
<ComboBoxItem Content="5分钟" Tag="5" />
|
||||
<ComboBoxItem Content="10分钟" Tag="10" />
|
||||
<ComboBoxItem Content="15分钟" Tag="15" />
|
||||
<ComboBoxItem Content="30分钟" Tag="30" />
|
||||
<ComboBoxItem Content="60分钟" Tag="60" />
|
||||
</ComboBox>
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 开启后将在设定时间间隔自动保存墨迹,仅在画布可见且有墨迹时才会保存" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="墨迹全页面保存" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -3249,6 +3267,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 +3326,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="计时器设置"
|
||||
@@ -9369,7 +9452,7 @@
|
||||
|
||||
MouseUp="TwoFingerGestureBorder_MouseUp" Background="Transparent"
|
||||
Orientation="Vertical" HorizontalAlignment="Center" Width="36" Margin="0">
|
||||
<Image x:Name="EnableTwoFingerGestureBtn" Source="/Resources/new-icons/gesture.png"
|
||||
<Image x:Name="EnableTwoFingerGestureBtn" Source="{DynamicResource GestureIcon}"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="18"
|
||||
Margin="0,3,0,0" />
|
||||
<TextBlock x:Name="gestureiconText" Text="手势" Foreground="{DynamicResource FloatBarForeground}" FontSize="8"
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
// 第一个确认对话框
|
||||
@@ -1834,6 +1853,7 @@ namespace Ink_Canvas
|
||||
|
||||
// 添加定时器来维护置顶状态
|
||||
private DispatcherTimer topmostMaintenanceTimer;
|
||||
private DispatcherTimer autoSaveStrokesTimer;
|
||||
private bool isTopmostMaintenanceEnabled;
|
||||
|
||||
private void ApplyNoFocusMode()
|
||||
@@ -2509,7 +2529,9 @@ namespace Ink_Canvas
|
||||
BoardHighlighterWidthSlider,
|
||||
InkWidthSlider,
|
||||
InkAlphaSlider,
|
||||
HighlighterWidthSlider
|
||||
HighlighterWidthSlider,
|
||||
MLAvoidanceHistorySlider,
|
||||
MLAvoidanceWeightSlider
|
||||
};
|
||||
|
||||
foreach (var slider in sliders)
|
||||
@@ -3053,6 +3075,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace Ink_Canvas
|
||||
// 刷新图片选中栏图标
|
||||
RefreshImageSelectionIcons();
|
||||
|
||||
// 刷新手势按钮图标
|
||||
RefreshGestureButtonIcon();
|
||||
|
||||
RefreshFloatingBarHighlightColors();
|
||||
|
||||
if (autoSwitchIcon)
|
||||
@@ -109,6 +112,9 @@ namespace Ink_Canvas
|
||||
// 刷新图片选中栏图标
|
||||
RefreshImageSelectionIcons();
|
||||
|
||||
// 刷新手势按钮图标
|
||||
RefreshGestureButtonIcon();
|
||||
|
||||
RefreshFloatingBarHighlightColors();
|
||||
|
||||
if (autoSwitchIcon)
|
||||
@@ -492,6 +498,21 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新手势按钮图标
|
||||
/// </summary>
|
||||
private void RefreshGestureButtonIcon()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 调用手势按钮颜色和图标更新方法,该方法会根据当前主题和手势状态设置正确的图标
|
||||
CheckEnableTwoFingerGestureBtnColorPrompt();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新其他窗口的主题
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
@@ -857,4 +857,4 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +80,7 @@ namespace Ink_Canvas
|
||||
// 多指书写模式启用时,手势功能被禁用
|
||||
TwoFingerGestureSimpleStackPanel.Opacity = 0.5;
|
||||
TwoFingerGestureSimpleStackPanel.IsHitTestVisible = false;
|
||||
EnableTwoFingerGestureBtn.Source =
|
||||
new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
|
||||
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon");
|
||||
|
||||
// 根据主题设置颜色
|
||||
if (Settings.Appearance.Theme == 1) // 深色主题
|
||||
@@ -117,8 +116,7 @@ namespace Ink_Canvas
|
||||
|
||||
if (hasGestureEnabled)
|
||||
{
|
||||
EnableTwoFingerGestureBtn.Source =
|
||||
new BitmapImage(new Uri("/Resources/new-icons/gesture-enabled.png", UriKind.Relative));
|
||||
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIconEnabled");
|
||||
|
||||
BoardGesture.Background = new SolidColorBrush(Color.FromRgb(37, 99, 235));
|
||||
BoardGestureGeometry.Brush = new SolidColorBrush(Colors.GhostWhite);
|
||||
@@ -130,8 +128,7 @@ namespace Ink_Canvas
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableTwoFingerGestureBtn.Source =
|
||||
new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
|
||||
EnableTwoFingerGestureBtn.Source = (BitmapImage)Application.Current.FindResource("GestureIcon");
|
||||
|
||||
// 根据主题设置颜色
|
||||
if (Settings.Appearance.Theme == 1) // 深色主题
|
||||
@@ -176,11 +173,16 @@ namespace Ink_Canvas
|
||||
return;
|
||||
}
|
||||
|
||||
// 在屏幕模式(非放映模式)下,不显示手势按钮
|
||||
if (currentMode == 0)
|
||||
{
|
||||
EnableTwoFingerGestureBorder.Visibility = Visibility.Collapsed;
|
||||
return;
|
||||
if (GridTransparencyFakeBackground.Background != Brushes.Transparent && isVisible)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableTwoFingerGestureBorder.Visibility = Visibility.Collapsed;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (StackPanelCanvasControls.Visibility != Visibility.Visible
|
||||
@@ -1085,11 +1087,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 +1137,7 @@ namespace Ink_Canvas
|
||||
LogHelper.WriteLogToFile($"强制置顶RandWindow失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}), DispatcherPriority.Loaded);
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckEraserTypeTab()
|
||||
@@ -1232,14 +1244,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1997,8 +2025,6 @@ namespace Ink_Canvas
|
||||
// 禁用高级橡皮擦系统
|
||||
DisableEraserOverlay();
|
||||
|
||||
ExitMultiTouchModeIfNeeded();
|
||||
|
||||
SetFloatingBarHighlightPosition("pen");
|
||||
|
||||
// 记录当前是否已经是批注模式且是否为高光显示模式
|
||||
@@ -2840,39 +2866,14 @@ namespace Ink_Canvas
|
||||
// 恢复非笔画元素
|
||||
RestoreNonStrokeElements(preservedElements);
|
||||
|
||||
CancelSingleFingerDragMode();
|
||||
|
||||
if (Settings.Canvas.ClearCanvasAndClearTimeMachine) timeMachine.ClearStrokeHistory();
|
||||
|
||||
if (Settings.Gesture.IsEnableMultiTouchMode && ToggleSwitchEnableMultiTouchMode != null && ToggleSwitchEnableMultiTouchMode.IsOn)
|
||||
{
|
||||
ReinitializeMultiTouchMode();
|
||||
}
|
||||
CancelSingleFingerDragMode();
|
||||
|
||||
}
|
||||
|
||||
private bool lastIsInMultiTouchMode;
|
||||
|
||||
private void ReinitializeMultiTouchMode()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!isInMultiTouchMode)
|
||||
{
|
||||
isInMultiTouchMode = true;
|
||||
}
|
||||
|
||||
inkCanvas.TouchDown -= Main_Grid_TouchDown;
|
||||
inkCanvas.TouchDown += MainWindow_TouchDown;
|
||||
inkCanvas.StylusDown += MainWindow_StylusDown;
|
||||
inkCanvas.StylusMove += MainWindow_StylusMove;
|
||||
inkCanvas.StylusUp += MainWindow_StylusUp;
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelSingleFingerDragMode()
|
||||
{
|
||||
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn) CollapseBorderDrawShape();
|
||||
@@ -2881,8 +2882,6 @@ namespace Ink_Canvas
|
||||
|
||||
if (isSingleFingerDragMode) BtnFingerDragMode_Click(BtnFingerDragMode, null);
|
||||
isLongPressSelected = false;
|
||||
|
||||
ResetTouchStates();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2895,17 +2894,6 @@ namespace Ink_Canvas
|
||||
// 清空触摸点计数器
|
||||
dec.Clear();
|
||||
|
||||
|
||||
// 重置单指拖动模式状态
|
||||
if (isSingleFingerDragMode)
|
||||
{
|
||||
isSingleFingerDragMode = false;
|
||||
if (BtnFingerDragMode != null)
|
||||
{
|
||||
BtnFingerDragMode.Content = "单指\n拖动";
|
||||
}
|
||||
}
|
||||
|
||||
// 重置手掌擦状态
|
||||
if (isPalmEraserActive)
|
||||
{
|
||||
|
||||
@@ -1877,6 +1877,29 @@ namespace Ink_Canvas
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableAutoSaveStrokes_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsEnableAutoSaveStrokes = ToggleSwitchEnableAutoSaveStrokes.IsOn;
|
||||
SaveSettingsToFile();
|
||||
// 更新定时器状态
|
||||
UpdateAutoSaveStrokesTimer();
|
||||
}
|
||||
|
||||
private void ComboBoxAutoSaveStrokesInterval_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded || ComboBoxAutoSaveStrokesInterval.SelectedItem == null) return;
|
||||
|
||||
var selectedItem = ComboBoxAutoSaveStrokesInterval.SelectedItem as System.Windows.Controls.ComboBoxItem;
|
||||
if (selectedItem?.Tag != null && int.TryParse(selectedItem.Tag.ToString(), out int intervalMinutes))
|
||||
{
|
||||
Settings.Automation.AutoSaveStrokesIntervalMinutes = intervalMinutes;
|
||||
SaveSettingsToFile();
|
||||
// 更新定时器间隔
|
||||
UpdateAutoSaveStrokesTimer();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Gesture
|
||||
@@ -2671,6 +2694,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 +2792,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;
|
||||
@@ -1045,6 +1053,23 @@ namespace Ink_Canvas
|
||||
|
||||
ToggleSwitchSaveFullPageStrokes.IsOn = Settings.Automation.IsSaveFullPageStrokes;
|
||||
|
||||
// 加载定时保存墨迹设置
|
||||
ToggleSwitchEnableAutoSaveStrokes.IsOn = Settings.Automation.IsEnableAutoSaveStrokes;
|
||||
// 初始化保存间隔下拉框
|
||||
if (ComboBoxAutoSaveStrokesInterval != null)
|
||||
{
|
||||
int intervalMinutes = Settings.Automation.AutoSaveStrokesIntervalMinutes;
|
||||
if (intervalMinutes < 1) intervalMinutes = 5; // 默认5分钟
|
||||
foreach (System.Windows.Controls.ComboBoxItem item in ComboBoxAutoSaveStrokesInterval.Items)
|
||||
{
|
||||
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out int tagValue) && tagValue == intervalMinutes)
|
||||
{
|
||||
ComboBoxAutoSaveStrokesInterval.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SideControlMinimumAutomationSlider.Value = Settings.Automation.MinimumAutomationStrokeNumber;
|
||||
|
||||
AutoSavedStrokesLocation.Text = Settings.Automation.AutoSavedStrokesLocation;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -2143,4 +2143,4 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
@@ -148,6 +149,55 @@ namespace Ink_Canvas
|
||||
LogHelper.WriteLogToFile($"程序启动时NTP同步失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化定时保存墨迹定时器
|
||||
InitAutoSaveStrokesTimer();
|
||||
}
|
||||
|
||||
// 初始化定时保存墨迹定时器
|
||||
private void InitAutoSaveStrokesTimer()
|
||||
{
|
||||
if (autoSaveStrokesTimer == null)
|
||||
{
|
||||
autoSaveStrokesTimer = new DispatcherTimer();
|
||||
autoSaveStrokesTimer.Tick += AutoSaveStrokesTimer_Tick;
|
||||
}
|
||||
|
||||
// 根据设置更新定时器间隔和启动状态
|
||||
UpdateAutoSaveStrokesTimer();
|
||||
}
|
||||
|
||||
// 更新定时保存墨迹定时器状态
|
||||
private void UpdateAutoSaveStrokesTimer()
|
||||
{
|
||||
if (autoSaveStrokesTimer == null) return;
|
||||
|
||||
autoSaveStrokesTimer.Stop();
|
||||
|
||||
if (Settings.Automation.IsEnableAutoSaveStrokes)
|
||||
{
|
||||
int intervalMinutes = Settings.Automation.AutoSaveStrokesIntervalMinutes;
|
||||
if (intervalMinutes < 1) intervalMinutes = 1; // 最小间隔1分钟
|
||||
autoSaveStrokesTimer.Interval = TimeSpan.FromMinutes(intervalMinutes);
|
||||
autoSaveStrokesTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
// 定时保存墨迹定时器事件处理
|
||||
private void AutoSaveStrokesTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 只有在画布可见且有墨迹时才保存
|
||||
if (inkCanvas.Visibility == Visibility.Visible && inkCanvas.Strokes.Count > 0)
|
||||
{
|
||||
// 静默保存
|
||||
SaveInkCanvasStrokes(false, false);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// NTP同步定时器事件处理
|
||||
|
||||
@@ -799,58 +799,6 @@ namespace Ink_Canvas
|
||||
isMultiTouchTimerActive = false;
|
||||
}
|
||||
|
||||
|
||||
// 当手掌擦激活且所有触摸点都抬起时,恢复原编辑模式
|
||||
if (isPalmEraserActive && dec.Count == 0)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"Palm eraser recovery triggered - Touch points remaining: {dec.Count}");
|
||||
|
||||
// 恢复高光状态
|
||||
drawingAttributes.IsHighlighter = palmEraserLastIsHighlighter;
|
||||
|
||||
// 恢复编辑模式
|
||||
try
|
||||
{
|
||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
||||
{
|
||||
// 根据之前的状态恢复
|
||||
switch (palmEraserLastEditingMode)
|
||||
{
|
||||
case InkCanvasEditingMode.Ink:
|
||||
PenIcon_Click(null, null);
|
||||
break;
|
||||
case InkCanvasEditingMode.Select:
|
||||
SymbolIconSelect_MouseUp(null, null);
|
||||
break;
|
||||
default:
|
||||
inkCanvas.EditingMode = palmEraserLastEditingMode;
|
||||
break;
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile($"Palm eraser recovered to mode: {palmEraserLastEditingMode}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 如果恢复失败,强制切换到批注模式
|
||||
LogHelper.WriteLogToFile($"Palm eraser recovery failed: {ex.Message}, forcing to Ink mode", LogHelper.LogType.Error);
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
}
|
||||
|
||||
// 重置手掌擦状态
|
||||
isPalmEraserActive = false;
|
||||
|
||||
// 禁用橡皮擦覆盖层
|
||||
DisableEraserOverlay();
|
||||
if (Settings.Canvas.IsShowCursor)
|
||||
{
|
||||
inkCanvas.ForceCursor = true;
|
||||
inkCanvas.UseCustomCursor = true;
|
||||
}
|
||||
|
||||
LogHelper.WriteLogToFile("Palm eraser state reset completed");
|
||||
}
|
||||
|
||||
if (drawingShapeMode != 0)
|
||||
{
|
||||
isTouchDown = false;
|
||||
|
||||
@@ -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.17.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.17.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>
|
||||
@@ -462,6 +462,12 @@ namespace Ink_Canvas
|
||||
[JsonProperty("isAutoEnterAnnotationAfterKillHite")]
|
||||
public bool IsAutoEnterAnnotationAfterKillHite { get; set; }
|
||||
|
||||
[JsonProperty("isEnableAutoSaveStrokes")]
|
||||
public bool IsEnableAutoSaveStrokes { get; set; } = true;
|
||||
|
||||
[JsonProperty("autoSaveStrokesIntervalMinutes")]
|
||||
public int AutoSaveStrokesIntervalMinutes { get; set; } = 5;
|
||||
|
||||
[JsonProperty("floatingWindowInterceptor")]
|
||||
public FloatingWindowInterceptorSettings FloatingWindowInterceptor { get; set; } = new FloatingWindowInterceptorSettings();
|
||||
}
|
||||
@@ -650,6 +656,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
|
||||
|
||||
@@ -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"/>
|
||||
@@ -145,4 +145,8 @@
|
||||
<BitmapImage x:Key="HandMoveIcon" UriSource="/Resources/new-icons/hand-move_white.png"/>
|
||||
<BitmapImage x:Key="ZoomIcon" UriSource="/Resources/new-icons/zoom_white.png"/>
|
||||
<BitmapImage x:Key="RotateIcon" UriSource="/Resources/new-icons/rotate_white.png"/>
|
||||
|
||||
<!-- 浮动栏手势按钮图标资源 - 深色主题 -->
|
||||
<BitmapImage x:Key="GestureIcon" UriSource="/Resources/new-icons/gesture_white.png"/>
|
||||
<BitmapImage x:Key="GestureIconEnabled" UriSource="/Resources/new-icons/gesture-enabled.png"/>
|
||||
</ResourceDictionary>
|
||||
@@ -145,4 +145,8 @@
|
||||
<BitmapImage x:Key="HandMoveIcon" UriSource="/Resources/new-icons/hand-move.png"/>
|
||||
<BitmapImage x:Key="ZoomIcon" UriSource="/Resources/new-icons/zoom.png"/>
|
||||
<BitmapImage x:Key="RotateIcon" UriSource="/Resources/new-icons/rotate.png"/>
|
||||
|
||||
<!-- 浮动栏手势按钮图标资源 - 浅色主题 -->
|
||||
<BitmapImage x:Key="GestureIcon" UriSource="/Resources/new-icons/gesture.png"/>
|
||||
<BitmapImage x:Key="GestureIconEnabled" UriSource="/Resources/new-icons/gesture-enabled.png"/>
|
||||
</ResourceDictionary>
|
||||
@@ -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>
|
||||
|
||||
@@ -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,529 @@
|
||||
<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">
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result1Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result2Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result3Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result4Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result5Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
<!-- 第2行:结果6-10 -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result6Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result7Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result8Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result9Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result10Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
<!-- 第3行:结果11-15 -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result11Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result12Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result13Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result14Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result15Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
<!-- 第4行:结果16-20 -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result16Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result17Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result18Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result19Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
<Viewbox Width="60" Height="36" Stretch="Uniform" ClipToBounds="True">
|
||||
<TextBlock x:Name="Result20Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" />
|
||||
</Viewbox>
|
||||
</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"/>
|
||||
|
||||
<!-- 外部点名模式选择 -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 外部点名模式Tab -->
|
||||
<Border Grid.Column="0"
|
||||
Background="{DynamicResource NewRollCallWindowButtonBackground}"
|
||||
CornerRadius="8"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#616161"
|
||||
Width="100" Height="40">
|
||||
<Grid>
|
||||
<!-- 背景指示器 -->
|
||||
<Border x:Name="ExternalCallerModeIndicator"
|
||||
Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
|
||||
CornerRadius="7.5"
|
||||
Width="100" Height="38"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,0,0"
|
||||
Visibility="Collapsed"/>
|
||||
|
||||
<!-- 按钮容器 -->
|
||||
<Button x:Name="ExternalCallerModeBtn"
|
||||
Width="100" Height="40"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Click="ExternalCallerMode_Click"
|
||||
Cursor="Hand">
|
||||
<TextBlock x:Name="ExternalCallerModeText" Text="外部点名" FontSize="16" FontWeight="Normal"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 外部点名类型下拉框 -->
|
||||
<ComboBox x:Name="ExternalCallerTypeComboBox"
|
||||
Grid.Column="2"
|
||||
Width="160" Height="40"
|
||||
IsEditable="False"
|
||||
IsReadOnly="True"
|
||||
SelectedIndex="0"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
|
||||
SelectionChanged="ExternalCallerTypeComboBox_SelectionChanged">
|
||||
<ComboBoxItem Content="ClassIsland" IsSelected="True"/>
|
||||
<ComboBoxItem Content="SecRandom"/>
|
||||
<ComboBoxItem Content="NamePicker"/>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</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="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 x:Name="StartRollCallBtnIcon" 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 x:Name="StartRollCallBtnText" 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,254 @@
|
||||
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();
|
||||
|
||||
// 如果主窗口在无焦点模式下,启动置顶维护
|
||||
if (MainWindow.Settings?.Advanced?.IsNoFocusMode == true &&
|
||||
MainWindow.Settings?.Advanced?.EnableUIAccessTopMost != true)
|
||||
{
|
||||
StartTopmostMaintenance();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool IsWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool IsWindowVisible(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool IsIconic(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetForegroundWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern uint GetCurrentProcessId();
|
||||
|
||||
private const int GWL_EXSTYLE = -20;
|
||||
private const int WS_EX_TOPMOST = 0x00000008;
|
||||
private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
|
||||
private static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
|
||||
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;
|
||||
|
||||
// 添加定时器来维护置顶状态
|
||||
private DispatcherTimer topmostMaintenanceTimer;
|
||||
private bool isTopmostMaintenanceEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// 应用悬浮按钮置顶
|
||||
/// </summary>
|
||||
private void ApplyFloatingButtonTopmost()
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"应用快抽悬浮按钮置顶失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动置顶维护定时器
|
||||
/// </summary>
|
||||
private void StartTopmostMaintenance()
|
||||
{
|
||||
if (MainWindow.Settings?.Advanced?.EnableUIAccessTopMost == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isTopmostMaintenanceEnabled) return;
|
||||
|
||||
if (topmostMaintenanceTimer == null)
|
||||
{
|
||||
topmostMaintenanceTimer = new DispatcherTimer();
|
||||
topmostMaintenanceTimer.Interval = TimeSpan.FromMilliseconds(500); // 每500ms检查一次
|
||||
topmostMaintenanceTimer.Tick += TopmostMaintenanceTimer_Tick;
|
||||
}
|
||||
|
||||
topmostMaintenanceTimer.Start();
|
||||
isTopmostMaintenanceEnabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 停止置顶维护定时器
|
||||
/// </summary>
|
||||
private void StopTopmostMaintenance()
|
||||
{
|
||||
if (topmostMaintenanceTimer != null && isTopmostMaintenanceEnabled)
|
||||
{
|
||||
topmostMaintenanceTimer.Stop();
|
||||
isTopmostMaintenanceEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 置顶维护定时器事件
|
||||
/// </summary>
|
||||
private void TopmostMaintenanceTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainWindow.Settings?.Advanced?.EnableUIAccessTopMost == true)
|
||||
{
|
||||
StopTopmostMaintenance();
|
||||
return;
|
||||
}
|
||||
|
||||
if (MainWindow.Settings?.Advanced?.IsNoFocusMode != true)
|
||||
{
|
||||
StopTopmostMaintenance();
|
||||
return;
|
||||
}
|
||||
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
if (hwnd == IntPtr.Zero) return;
|
||||
|
||||
// 检查窗口是否仍然可见且不是最小化状态
|
||||
if (!IsWindow(hwnd) || !IsWindowVisible(hwnd) || IsIconic(hwnd))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否有子窗口在前景
|
||||
var foregroundWindow = GetForegroundWindow();
|
||||
if (foregroundWindow != hwnd)
|
||||
{
|
||||
// 检查前景窗口是否是当前应用程序的子窗口
|
||||
var foregroundWindowProcessId = GetWindowThreadProcessId(foregroundWindow, out uint processId);
|
||||
var currentProcessId = GetCurrentProcessId();
|
||||
|
||||
if (processId == currentProcessId)
|
||||
{
|
||||
// 如果有子窗口在前景,暂停置顶维护
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果窗口不在最顶层且没有子窗口,重新设置置顶
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
|
||||
|
||||
// 确保窗口样式正确
|
||||
int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
if ((exStyle & WS_EX_TOPMOST) == 0)
|
||||
{
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_TOPMOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"快抽悬浮按钮置顶维护定时器出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭时停止置顶维护定时器
|
||||
/// </summary>
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
StopTopmostMaintenance();
|
||||
base.OnClosed(e);
|
||||
}
|
||||
#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>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -393,9 +393,9 @@ namespace Ink_Canvas.Windows
|
||||
|
||||
case 1: // 跟随四季
|
||||
var month = DateTime.Now.Month;
|
||||
if (month >= 3 && month <= 5) return GetImageNameByStyle(2); // 春季
|
||||
if (month >= 6 && month <= 8) return GetImageNameByStyle(3); // 夏季
|
||||
if (month >= 9 && month <= 11) return GetImageNameByStyle(4); // 秋季
|
||||
if (month >= 2 && month <= 4) return GetImageNameByStyle(2); // 春季
|
||||
if (month >= 5 && month <= 7) return GetImageNameByStyle(3); // 夏季
|
||||
if (month >= 8 && month <= 10) return GetImageNameByStyle(4); // 秋季
|
||||
return GetImageNameByStyle(5); // 冬季
|
||||
|
||||
case 2: // 春季
|
||||
|
||||
@@ -20,21 +20,17 @@
|
||||
|
||||
</div>
|
||||
|
||||
## 🤔 发生了什么?
|
||||
## 💫 软件说明
|
||||
|
||||
|
||||
由于众所周知的原因,[DotteringDoge471](https://github.com/DotteringDoge471) 不再积极负责 InkCanvasForClass 旧时代版本的开发与维护工作,而刚好 [CJKmkp](https://github.com/CJKmkp) 又维护了这个社区版本的 icc,经过沟通后就顺理成章地成为了 icc 的官方版本。该分支版本 **目前还在开发之中** ,可能会有潜在的问题/ Bug 出现,请在出现 Bug 后与开发者或与 [DotteringDoge471](https://github.com/DotteringDoge471) 上报,方便我们迅速诊断并解决问题。
|
||||
|
||||
> ⚠️ 请注意:[DotteringDoge471](https://github.com/DotteringDoge471) 不积极负责 **本社区版本** 的开发与维护工作,仅会在有空的时候对本项目开发新功能或修复 Bug。因此,任何问题反馈/Bug反馈/建议等,请优先找本项目主要维护者 [CJKmkp](https://github.com/CJKmkp) 反馈或在 GitHub 仓库内提出 Issue!
|
||||
|
||||
使用该版本 InkCanvasForClass,意味着您同意自行承担任何可能存在的问题与风险。建议不要在公众场合(例如公开课,录播课,线上直播课,大型会议)使用未经广泛测试和优化的 Beta 版本,对使用 Beta 版本而带来的任何问题和风险(例如:被班主任批斗,被校长处罚,崩溃而导致的场面混乱,全球海平面上升等),**将由使用者自行承担**,[CJKmkp](https://github.com/CJKmkp) 和 [DotteringDoge471](https://github.com/DotteringDoge471) 及其项目的所有维护者不提供任何担保。
|
||||
使用该版本 InkCanvasForClass,意味着您同意自行承担任何可能存在的问题与风险。建议不要在公众场合(例如公开课,录播课,线上直播课,大型会议)使用未经广泛测试和优化的 Beta 版本,对使用 Beta 版本而带来的任何问题和风险(例如:被班主任批斗,被校长处罚,崩溃而导致的场面混乱,全球海平面上升等),**将由使用者自行承担**,[CJKmkp](https://github.com/CJKmkp) 及其项目的所有维护者不提供任何担保。
|
||||
|
||||
♥️ **本项目版权归 [CJKmkp](https://github.com/CJKmkp) 所有。[CJKmkp](https://github.com/CJKmkp) 拥有最终解释权。**
|
||||
|
||||
**智教联盟 InkCanvasForClass Community Edition 板块:** [forum.smart-teach.cn/t/icc-ce](https://forum.smart-teach.cn/t/icc-ce) ,我们会在此处发布版本更新日志,同时,您也可以在遵守论坛对应管理规则与InkCanvasForClass Community Edition 板块管理条约的情况下,在该板块内提问或发表自己的使用体验。
|
||||
|
||||
## ⚠️ 使用须知
|
||||
在使用和分发本软件前,请务必了解相关开源协议。本软件基于 https://github.com/Awesome-Iwb/icc-0610fix 修改而来,而 icc-0610fix 基于 https://github.com/ChangSakura/Ink-Canvas 修改,ica 则基于 https://github.com/WXRIW/Ink-Canvas 修改,增加了包括但不限于隐藏到侧边栏等功能,更改了相关UI和软件操作逻辑。对于墨迹书写功能以及 ica 独有功能的相关问题反馈,建议优先查阅 https://github.com/WXRIW/Ink-Canvas/issues 。**使用前建议戴上大脑使用。**
|
||||
|
||||
在使用和分发本软件前,请务必了解相关开源协议。本软件基于 <https://github.com/InkCanvasForClass/icc-20240610-stable> 修改而来,而 icc-20240610-stable 基于 <https://github.com/ChangSakura/Ink-Canvas> 修改,ica 则基于 <https://github.com/WXRIW/Ink-Canvas> 修改,增加了包括但不限于隐藏到侧边栏等功能,更改了相关UI和软件操作逻辑。对于墨迹书写功能以及 ica 独有功能的相关问题反馈,建议优先查阅 <https://github.com/WXRIW/Ink-Canvas/issues> 。**使用前建议戴上大脑使用。**
|
||||
|
||||
# 💬 提示
|
||||
- 对于新功能的有效意见和合理建议,开发者会适时回复并进行开发。本软件并非商业性质软件或由营利性机构驱动,请不要催促开发者,耐心等待能让功能少些Bug,更加稳定。
|
||||
@@ -62,13 +58,8 @@
|
||||
|
||||
如果仍无法运行,请[安装 `Microsoft Office`](https://www.coolhub.top/archives/11)。
|
||||
|
||||
### 程序能在 Wine 环境中运行吗?
|
||||
不能,但是你可以期待 icc-gtk4,是正在开发的仅支持 Linux 平台的 icc 移植版本。
|
||||
|
||||
## ✏️ 贡献指南
|
||||
|
||||
请前往 InkCanvasForClass/dubious-notes
|
||||
|
||||
**请注意,在贡献代码时,_务必_ 将所有代码提交到 _beta_ 分支,以保证beta版本总是新于main版本。**
|
||||
|
||||
## TODO LIST
|
||||
@@ -105,13 +96,12 @@
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
## 🤝 感谢
|
||||
感谢 [DotteringDoge471](https://github.com/DotteringDoge471) 创造了 `InkCanvasForClass`!
|
||||
|
||||
感谢 [yuwenhui2020](https://github.com/yuwenhui2020) 为 `Ink Canvas 使用说明` 做出的贡献!
|
||||
感谢 [CN-Ironegg](https://github.com/CN-Ironegg)、[jiajiaxd](https://github.com/jiajiaxd)、[Kengwang](https://github.com/kengwang)、[Raspberry Kan](https://github.com/Raspberry-Monster)、[clover-yan](https://github.com/clover-yan)、[STBBRD](https://github.com/STBBRD)、[ChangSakura](https://github.com/WuChanging)、[DotteringDoge471](https://github.com/DotteringDoge471) 为本项目贡献代码!
|
||||
感谢 [CN-Ironegg](https://github.com/CN-Ironegg)、[jiajiaxd](https://github.com/jiajiaxd)、[Kengwang](https://github.com/kengwang)、[Raspberry Kan](https://github.com/Raspberry-Monster)、[clover-yan](https://github.com/clover-yan)、[STBBRD](https://github.com/STBBRD)、[ChangSakura](https://github.com/WuChanging) 为本项目贡献代码!
|
||||
|
||||
## License
|
||||
GPLv3
|
||||
|
||||
## 项目引用
|
||||
[Alan-CRL/DesktopDrawpadBlocker](https://github.com/Alan-CRL/DesktopDrawpadBlocker)
|
||||
[Awesome-Iwb/iwbicons-gallery](https://github.com/awesome-iwb/awesome-iwb/wiki/iwbicons-gallery)「本项目部分图标来自 Awesome Iwb 的 IwbIcons 图标库,由 Douxiba 制作。」
|
||||
|
||||
@@ -100,3 +100,6 @@ ICC CE 1.7.X.X更新日志
|
||||
99. 修复仅调色盘状态下浮动栏不居中
|
||||
100. 修复希沃白板查杀与思锐希沃启动器导致的重复启动
|
||||
101. 新增UIA窗口置顶
|
||||
102. 新增新点名窗口
|
||||
103. 新增点名快抽
|
||||
104. 新增墨迹自动保存
|
||||
|
||||
Reference in New Issue
Block a user