@@ -1 +1 @@
|
||||
1.7.16.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.16.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.16.0")]
|
||||
[assembly: AssemblyVersion("1.7.17.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.17.0")]
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Ink_Canvas.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// 位置计算转换器
|
||||
/// </summary>
|
||||
public class PositionConverters
|
||||
{
|
||||
/// <summary>
|
||||
/// 减法转换器
|
||||
/// </summary>
|
||||
public class SubtractConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double baseValue && parameter is string paramStr)
|
||||
{
|
||||
if (double.TryParse(paramStr, out double subtractValue))
|
||||
{
|
||||
return baseValue - subtractValue;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
+28
-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" />
|
||||
@@ -9434,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"
|
||||
|
||||
@@ -1853,6 +1853,7 @@ namespace Ink_Canvas
|
||||
|
||||
// 添加定时器来维护置顶状态
|
||||
private DispatcherTimer topmostMaintenanceTimer;
|
||||
private DispatcherTimer autoSaveStrokesTimer;
|
||||
private bool isTopmostMaintenanceEnabled;
|
||||
|
||||
private void ApplyNoFocusMode()
|
||||
|
||||
@@ -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
|
||||
@@ -2023,8 +2025,6 @@ namespace Ink_Canvas
|
||||
// 禁用高级橡皮擦系统
|
||||
DisableEraserOverlay();
|
||||
|
||||
ExitMultiTouchModeIfNeeded();
|
||||
|
||||
SetFloatingBarHighlightPosition("pen");
|
||||
|
||||
// 记录当前是否已经是批注模式且是否为高光显示模式
|
||||
@@ -2866,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();
|
||||
@@ -2907,8 +2882,6 @@ namespace Ink_Canvas
|
||||
|
||||
if (isSingleFingerDragMode) BtnFingerDragMode_Click(BtnFingerDragMode, null);
|
||||
isLongPressSelected = false;
|
||||
|
||||
ResetTouchStates();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2921,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
|
||||
|
||||
@@ -1053,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.16.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.16.0")]
|
||||
[assembly: AssemblyVersion("1.7.17.0")]
|
||||
[assembly: AssemblyFileVersion("1.7.17.0")]
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -3,7 +3,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -143,6 +142,17 @@ namespace Ink_Canvas
|
||||
// 点名模式
|
||||
private string selectedRollCallMode = "Random"; // 默认随机点名
|
||||
|
||||
// 外部点名相关
|
||||
private string selectedExternalCaller = "ClassIsland";
|
||||
|
||||
// 开始点名按钮的数据
|
||||
private string originalStartBtnIconData = "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";
|
||||
private string originalStartBtnText = "开始点名";
|
||||
|
||||
// 外部点名按钮的数据
|
||||
private string externalCallerBtnIconData = "M9 15L15 9 M11 6L11.463 5.464C12.4008 4.52633 13.6727 3.9996 14.9989 3.99969C16.325 3.99979 17.5968 4.52669 18.5345 5.4645C19.4722 6.40231 19.9989 7.67419 19.9988 9.00035C19.9987 10.3265 19.4718 11.5983 18.534 12.536L18 13 M13.0001 18L12.6031 18.534C11.6544 19.4722 10.3739 19.9984 9.03964 19.9984C7.70535 19.9984 6.42489 19.4722 5.47614 18.534C5.0085 18.0716 4.63724 17.521 4.38385 16.9141C4.13047 16.3073 4 15.6561 4 14.9985C4 14.3408 4.13047 13.6897 4.38385 13.0829C4.63724 12.476 5.0085 11.9254 5.47614 11.463L6.00014 11";
|
||||
private string externalCallerBtnText = "外部点名";
|
||||
|
||||
// JSON文件路径
|
||||
private static readonly string ConfigsFolder = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs");
|
||||
private static readonly string RollCallHistoryJsonPath = System.IO.Path.Combine(ConfigsFolder, "RollCallHistory.json");
|
||||
@@ -199,7 +209,12 @@ namespace Ink_Canvas
|
||||
{
|
||||
try
|
||||
{
|
||||
SetExternalCallerSelection("ClassIsland");
|
||||
// 初始化下拉框选择
|
||||
if (ExternalCallerTypeComboBox != null)
|
||||
{
|
||||
ExternalCallerTypeComboBox.SelectedIndex = 0; // 默认选择ClassIsland
|
||||
selectedExternalCaller = "ClassIsland";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -872,6 +887,13 @@ namespace Ink_Canvas
|
||||
GroupModeText.FontWeight = FontWeights.Normal;
|
||||
GroupModeText.Opacity = 0.6;
|
||||
GroupModeText.Foreground = new SolidColorBrush(Color.FromRgb(102, 102, 102));
|
||||
|
||||
// 重置外部点名模式按钮状态
|
||||
ExternalCallerModeText.FontWeight = FontWeights.Normal;
|
||||
ExternalCallerModeText.Opacity = 0.6;
|
||||
ExternalCallerModeText.Foreground = new SolidColorBrush(Color.FromRgb(102, 102, 102));
|
||||
ExternalCallerModeIndicator.Visibility = Visibility.Collapsed;
|
||||
SegmentedIndicator.Visibility = Visibility.Visible;
|
||||
|
||||
// 设置选中状态和动画
|
||||
switch (mode)
|
||||
@@ -889,6 +911,8 @@ namespace Ink_Canvas
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
SegmentedIndicator.BeginAnimation(Border.MarginProperty, randomAnimation);
|
||||
|
||||
// 恢复开始点名按钮的原始图标和文字
|
||||
RestoreStartRollCallButton();
|
||||
UpdateStatusDisplay("已选择点名模式: 随机点名");
|
||||
break;
|
||||
case "Sequential":
|
||||
@@ -904,6 +928,8 @@ namespace Ink_Canvas
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
SegmentedIndicator.BeginAnimation(Border.MarginProperty, sequentialAnimation);
|
||||
|
||||
// 恢复开始点名按钮的原始图标和文字
|
||||
RestoreStartRollCallButton();
|
||||
UpdateStatusDisplay("已选择点名模式: 顺序点名");
|
||||
break;
|
||||
case "Group":
|
||||
@@ -919,8 +945,24 @@ namespace Ink_Canvas
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
SegmentedIndicator.BeginAnimation(Border.MarginProperty, groupAnimation);
|
||||
|
||||
// 恢复开始点名按钮的原始图标和文字
|
||||
RestoreStartRollCallButton();
|
||||
UpdateStatusDisplay("已选择点名模式: 分组点名");
|
||||
break;
|
||||
case "External":
|
||||
// 外部点名模式
|
||||
ExternalCallerModeText.FontWeight = FontWeights.Bold;
|
||||
ExternalCallerModeText.Opacity = 1.0;
|
||||
ExternalCallerModeText.Foreground = new SolidColorBrush(Colors.White);
|
||||
ExternalCallerModeIndicator.Visibility = Visibility.Visible;
|
||||
|
||||
// 隐藏其他模式的指示器
|
||||
SegmentedIndicator.Visibility = Visibility.Collapsed;
|
||||
|
||||
// 切换到外部点名按钮的图标和文字
|
||||
UpdateStartRollCallButtonForExternal();
|
||||
UpdateStatusDisplay($"已选择点名模式: 外部点名 ({selectedExternalCaller})");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -928,6 +970,67 @@ namespace Ink_Canvas
|
||||
LogHelper.WriteLogToFile($"设置点名模式选择时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新开始点名按钮为外部点名样式
|
||||
/// </summary>
|
||||
private void UpdateStartRollCallButtonForExternal()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新图标
|
||||
if (StartRollCallBtnIcon != null)
|
||||
{
|
||||
StartRollCallBtnIcon.Data = Geometry.Parse(externalCallerBtnIconData);
|
||||
// 外部点名使用按钮前景色而不是主按钮前景色
|
||||
StartRollCallBtnIcon.Stroke = (Brush)FindResource("NewRollCallWindowButtonForeground");
|
||||
}
|
||||
|
||||
// 更新文字
|
||||
if (StartRollCallBtnText != null)
|
||||
{
|
||||
StartRollCallBtnText.Text = externalCallerBtnText;
|
||||
StartRollCallBtnText.Foreground = (Brush)FindResource("NewRollCallWindowButtonForeground");
|
||||
}
|
||||
|
||||
// 更新按钮背景色为普通按钮背景
|
||||
StartRollCallBtn.Background = (Brush)FindResource("NewRollCallWindowButtonBackground");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"更新开始点名按钮为外部点名样式时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复开始点名按钮的原始样式
|
||||
/// </summary>
|
||||
private void RestoreStartRollCallButton()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 恢复图标
|
||||
if (StartRollCallBtnIcon != null)
|
||||
{
|
||||
StartRollCallBtnIcon.Data = Geometry.Parse(originalStartBtnIconData);
|
||||
StartRollCallBtnIcon.Stroke = (Brush)FindResource("NewRollCallWindowPrimaryButtonForeground");
|
||||
}
|
||||
|
||||
// 恢复文字
|
||||
if (StartRollCallBtnText != null)
|
||||
{
|
||||
StartRollCallBtnText.Text = originalStartBtnText;
|
||||
StartRollCallBtnText.Foreground = (Brush)FindResource("NewRollCallWindowPrimaryButtonForeground");
|
||||
}
|
||||
|
||||
// 恢复按钮背景色为主按钮背景
|
||||
StartRollCallBtn.Background = (Brush)FindResource("NewRollCallWindowPrimaryButtonBackground");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"恢复开始点名按钮原始样式时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void RandomMode_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -944,8 +1047,32 @@ namespace Ink_Canvas
|
||||
SetModeSelection("Group");
|
||||
}
|
||||
|
||||
private static bool isExternalCallerFirstClick = true;
|
||||
private string selectedExternalCaller = "ClassIsland";
|
||||
private void ExternalCallerMode_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetModeSelection("External");
|
||||
}
|
||||
|
||||
private void ExternalCallerTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ExternalCallerTypeComboBox.SelectedItem is ComboBoxItem selectedItem)
|
||||
{
|
||||
selectedExternalCaller = selectedItem.Content.ToString();
|
||||
|
||||
if (selectedRollCallMode == "External")
|
||||
{
|
||||
UpdateStatusDisplay($"已选择外部点名: {selectedExternalCaller}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"外部点名类型选择更改时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isExternalCallerFirstClick = true;
|
||||
|
||||
private void ExternalCaller_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -993,97 +1120,16 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
private void ClassIsland_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetExternalCallerSelection("ClassIsland");
|
||||
}
|
||||
|
||||
private void SecRandom_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetExternalCallerSelection("SecRandom");
|
||||
}
|
||||
|
||||
private void NamePicker_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetExternalCallerSelection("NamePicker");
|
||||
}
|
||||
|
||||
private void SetExternalCallerSelection(string caller)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 重置所有按钮状态
|
||||
ClassIslandText.FontWeight = FontWeights.Normal;
|
||||
ClassIslandText.Opacity = 0.6;
|
||||
ClassIslandText.Foreground = new SolidColorBrush(Color.FromRgb(102, 102, 102));
|
||||
SecRandomText.FontWeight = FontWeights.Normal;
|
||||
SecRandomText.Opacity = 0.6;
|
||||
SecRandomText.Foreground = new SolidColorBrush(Color.FromRgb(102, 102, 102));
|
||||
NamePickerText.FontWeight = FontWeights.Normal;
|
||||
NamePickerText.Opacity = 0.6;
|
||||
NamePickerText.Foreground = new SolidColorBrush(Color.FromRgb(102, 102, 102));
|
||||
|
||||
// 设置选中状态和动画
|
||||
switch (caller)
|
||||
{
|
||||
case "ClassIsland":
|
||||
ClassIslandText.FontWeight = FontWeights.Bold;
|
||||
ClassIslandText.Opacity = 1.0;
|
||||
ClassIslandText.Foreground = new SolidColorBrush(Colors.White);
|
||||
ExternalCallerIndicator.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
ExternalCallerIndicator.CornerRadius = new CornerRadius(7.5, 0, 0, 7.5);
|
||||
|
||||
// 添加动画效果
|
||||
var classIslandAnimation = new System.Windows.Media.Animation.ThicknessAnimation(
|
||||
new Thickness(0, 0, 0, 0),
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
ExternalCallerIndicator.BeginAnimation(Border.MarginProperty, classIslandAnimation);
|
||||
|
||||
selectedExternalCaller = "ClassIsland";
|
||||
UpdateStatusDisplay("已选择外部点名: ClassIsland");
|
||||
break;
|
||||
case "SecRandom":
|
||||
SecRandomText.FontWeight = FontWeights.Bold;
|
||||
SecRandomText.Opacity = 1.0;
|
||||
SecRandomText.Foreground = new SolidColorBrush(Colors.White);
|
||||
ExternalCallerIndicator.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
ExternalCallerIndicator.CornerRadius = new CornerRadius(0, 0, 0, 0);
|
||||
|
||||
// 添加动画效果
|
||||
var secRandomAnimation = new System.Windows.Media.Animation.ThicknessAnimation(
|
||||
new Thickness(120, 0, 0, 0),
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
ExternalCallerIndicator.BeginAnimation(Border.MarginProperty, secRandomAnimation);
|
||||
|
||||
selectedExternalCaller = "SecRandom";
|
||||
UpdateStatusDisplay("已选择外部点名: SecRandom");
|
||||
break;
|
||||
case "NamePicker":
|
||||
NamePickerText.FontWeight = FontWeights.Bold;
|
||||
NamePickerText.Opacity = 1.0;
|
||||
NamePickerText.Foreground = new SolidColorBrush(Colors.White);
|
||||
ExternalCallerIndicator.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
ExternalCallerIndicator.CornerRadius = new CornerRadius(0, 7.5, 7.5, 0);
|
||||
|
||||
// 添加动画效果
|
||||
var namePickerAnimation = new System.Windows.Media.Animation.ThicknessAnimation(
|
||||
new Thickness(240, 0, 0, 0),
|
||||
TimeSpan.FromMilliseconds(200));
|
||||
ExternalCallerIndicator.BeginAnimation(Border.MarginProperty, namePickerAnimation);
|
||||
|
||||
selectedExternalCaller = "NamePicker";
|
||||
UpdateStatusDisplay("已选择外部点名: NamePicker");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"设置外部点名选择时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartRollCall_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 如果是外部点名模式,调用外部点名
|
||||
if (selectedRollCallMode == "External")
|
||||
{
|
||||
ExternalCaller_Click(sender, e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSingleDrawMode)
|
||||
{
|
||||
// 单次抽模式:直接开始抽选
|
||||
@@ -1151,6 +1197,13 @@ namespace Ink_Canvas
|
||||
{
|
||||
List<string> usedNames = new List<string>();
|
||||
|
||||
// 确保动画期间主显示区域可见
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
MainResultDisplay.Visibility = Visibility.Visible;
|
||||
MultiResultScrollViewer.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
|
||||
for (int i = 0; i < animationTimes; i++)
|
||||
{
|
||||
// 随机选择一个名字进行动画显示
|
||||
@@ -1161,6 +1214,8 @@ namespace Ink_Canvas
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
// 确保主显示区域在动画期间保持可见
|
||||
MainResultDisplay.Visibility = Visibility.Visible;
|
||||
MainResultDisplay.Text = displayName;
|
||||
});
|
||||
}
|
||||
@@ -1212,6 +1267,13 @@ namespace Ink_Canvas
|
||||
{
|
||||
List<int> usedNumbers = new List<int>();
|
||||
|
||||
// 确保动画期间主显示区域可见
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
MainResultDisplay.Visibility = Visibility.Visible;
|
||||
MultiResultScrollViewer.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
|
||||
for (int i = 0; i < animationTimes; i++)
|
||||
{
|
||||
// 随机选择一个数字进行动画显示
|
||||
@@ -1219,6 +1281,8 @@ namespace Ink_Canvas
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
// 确保主显示区域在动画期间保持可见
|
||||
MainResultDisplay.Visibility = Visibility.Visible;
|
||||
MainResultDisplay.Text = randomNumber.ToString();
|
||||
});
|
||||
|
||||
@@ -1234,7 +1298,7 @@ namespace Ink_Canvas
|
||||
// 更新历史记录
|
||||
UpdateRollCallHistory(selectedNumbers);
|
||||
|
||||
// 显示结果
|
||||
// 显示结果(这里会根据结果数量决定显示主显示区域还是多结果区域)
|
||||
ShowResults(selectedNumbers);
|
||||
UpdateStatusDisplay($"抽选完成,共选择 {selectedNumbers.Count} 个数字");
|
||||
|
||||
|
||||
@@ -70,95 +70,135 @@
|
||||
<StackPanel x:Name="MultiResultPanel" Orientation="Vertical" HorizontalAlignment="Center">
|
||||
<!-- 第1行:结果1-5 -->
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,8">
|
||||
<TextBlock x:Name="Result1Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result2Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result3Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result4Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result5Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Width="60"/>
|
||||
<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">
|
||||
<TextBlock x:Name="Result6Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result7Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result8Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result9Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result10Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Width="60"/>
|
||||
<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">
|
||||
<TextBlock x:Name="Result11Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result12Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result13Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result14Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result15Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Width="60"/>
|
||||
<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">
|
||||
<TextBlock x:Name="Result16Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result17Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result18Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result19Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Margin="0,0,12,0" Width="60"/>
|
||||
<TextBlock x:Name="Result20Display" Text="" FontSize="24" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource NewRollCallWindowDigitForeground}"
|
||||
TextAlignment="Center" Width="60"/>
|
||||
<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>
|
||||
@@ -212,6 +252,7 @@
|
||||
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>
|
||||
@@ -301,57 +342,59 @@
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"
|
||||
HorizontalAlignment="Center" Margin="0,0,0,10"/>
|
||||
|
||||
<!-- 外部点名类型切换 -->
|
||||
<Border Background="{DynamicResource NewRollCallWindowButtonBackground}"
|
||||
CornerRadius="8"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#616161"
|
||||
Width="360" Height="40">
|
||||
<Grid>
|
||||
<!-- 背景指示器 -->
|
||||
<Border x:Name="ExternalCallerIndicator"
|
||||
Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
|
||||
CornerRadius="7.5,0,0,7.5"
|
||||
Width="120" Height="38"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,0,0"/>
|
||||
|
||||
<!-- 按钮容器 -->
|
||||
<!-- 外部点名模式选择 -->
|
||||
<Grid>
|
||||
<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>
|
||||
<Button x:Name="ClassIslandBtn"
|
||||
Width="120" Height="40"
|
||||
<!-- 背景指示器 -->
|
||||
<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="ClassIsland_Click"
|
||||
Cursor="Hand"
|
||||
HorizontalAlignment="Left">
|
||||
<TextBlock x:Name="ClassIslandText" Text="ClassIsland" FontSize="16" FontWeight="Bold"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
|
||||
</Button>
|
||||
<Button x:Name="SecRandomBtn"
|
||||
Width="120" Height="40"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Click="SecRandom_Click"
|
||||
Cursor="Hand"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock x:Name="SecRandomText" Text="SecRandom" FontSize="16" FontWeight="Normal"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
|
||||
</Button>
|
||||
<Button x:Name="NamePickerBtn"
|
||||
Width="120" Height="40"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Click="NamePicker_Click"
|
||||
Cursor="Hand"
|
||||
HorizontalAlignment="Right">
|
||||
<TextBlock x:Name="NamePickerText" Text="NamePicker" FontSize="16" FontWeight="Normal"
|
||||
Click="ExternalCallerMode_Click"
|
||||
Cursor="Hand">
|
||||
<TextBlock x:Name="ExternalCallerModeText" Text="外部点名" FontSize="16" FontWeight="Normal"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}" Opacity="0.6"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</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>
|
||||
|
||||
@@ -406,29 +449,6 @@
|
||||
<!-- 底部控制按钮区域 -->
|
||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<!-- 外部点名按钮 -->
|
||||
<Button x:Name="ExternalCallerBtn" Width="140" Height="60"
|
||||
Background="{DynamicResource NewRollCallWindowButtonBackground}"
|
||||
BorderThickness="0" Click="ExternalCaller_Click" Cursor="Hand" Margin="0,0,20,0">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="30">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Path Data="M9 15L15 9 M11 6L11.463 5.464C12.4008 4.52633 13.6727 3.9996 14.9989 3.99969C16.325 3.99979 17.5968 4.52669 18.5345 5.4645C19.4722 6.40231 19.9989 7.67419 19.9988 9.00035C19.9987 10.3265 19.4718 11.5983 18.534 12.536L18 13 M13.0001 18L12.6031 18.534C11.6544 19.4722 10.3739 19.9984 9.03964 19.9984C7.70535 19.9984 6.42489 19.4722 5.47614 18.534C5.0085 18.0716 4.63724 17.521 4.38385 16.9141C4.13047 16.3073 4 15.6561 4 14.9985C4 14.3408 4.13047 13.6897 4.38385 13.0829C4.63724 12.476 5.0085 11.9254 5.47614 11.463L6.00014 11"
|
||||
Stroke="{DynamicResource NewRollCallWindowButtonForeground}"
|
||||
StrokeThickness="2"
|
||||
Fill="Transparent"
|
||||
Width="20" Height="20"
|
||||
Stretch="Uniform"
|
||||
Margin="0,0,8,0"/>
|
||||
<TextBlock Text="外部点名" FontSize="18" FontWeight="Bold"
|
||||
Foreground="{DynamicResource NewRollCallWindowButtonForeground}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!-- 开始点名按钮 -->
|
||||
<Button x:Name="StartRollCallBtn" Width="140" Height="60" Background="{DynamicResource NewRollCallWindowPrimaryButtonBackground}"
|
||||
BorderThickness="0" Click="StartRollCall_Click" Cursor="Hand" Margin="0,0,20,0">
|
||||
@@ -440,14 +460,14 @@
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15"
|
||||
<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 Text="开始点名" FontSize="18" FontWeight="Bold"
|
||||
<TextBlock x:Name="StartRollCallBtnText" Text="开始点名" FontSize="18" FontWeight="Bold"
|
||||
Foreground="{DynamicResource NewRollCallWindowPrimaryButtonForeground}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
@@ -31,6 +31,13 @@ namespace Ink_Canvas
|
||||
|
||||
// 应用置顶
|
||||
ApplyFloatingButtonTopmost();
|
||||
|
||||
// 如果主窗口在无焦点模式下,启动置顶维护
|
||||
if (MainWindow.Settings?.Advanced?.IsNoFocusMode == true &&
|
||||
MainWindow.Settings?.Advanced?.EnableUIAccessTopMost != true)
|
||||
{
|
||||
StartTopmostMaintenance();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPositionToBottomRight()
|
||||
@@ -78,15 +85,39 @@ namespace Ink_Canvas
|
||||
[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>
|
||||
@@ -96,11 +127,6 @@ namespace Ink_Canvas
|
||||
{
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
if (hwnd == IntPtr.Zero) return;
|
||||
|
||||
// 强制激活窗口
|
||||
Activate();
|
||||
Focus();
|
||||
|
||||
// 设置WPF的Topmost属性
|
||||
Topmost = true;
|
||||
|
||||
@@ -113,13 +139,116 @@ namespace Ink_Canvas
|
||||
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 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 制作。」
|
||||
|
||||
@@ -102,3 +102,4 @@ ICC CE 1.7.X.X更新日志
|
||||
101. 新增UIA窗口置顶
|
||||
102. 新增新点名窗口
|
||||
103. 新增点名快抽
|
||||
104. 新增墨迹自动保存
|
||||
|
||||
Reference in New Issue
Block a user