add:多屏支持
This commit is contained in:
@@ -567,6 +567,36 @@ namespace Ink_Canvas.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 刷新多屏相关设置(开关和跟随鼠标策略)。
|
||||||
|
/// </summary>
|
||||||
|
public void RefreshMultiScreenSettings()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var advanced = MainWindow.Settings.Advanced;
|
||||||
|
_isMultiScreenMode = advanced.EnableMultiScreenSupport && ScreenDetectionHelper.HasMultipleScreens();
|
||||||
|
_enableScreenSpecificHotkeys = _isMultiScreenMode;
|
||||||
|
|
||||||
|
if (_isMultiScreenMode)
|
||||||
|
{
|
||||||
|
_currentScreen = advanced.FollowMouseForScreenSelection
|
||||||
|
? Screen.FromPoint(Control.MousePosition)
|
||||||
|
: ScreenDetectionHelper.GetWindowScreen(_mainWindow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currentScreen = ScreenDetectionHelper.GetPrimaryScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
RefreshHotkeysForCurrentScreen();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"刷新多屏设置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前屏幕信息
|
/// 获取当前屏幕信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -624,13 +654,15 @@ namespace Ink_Canvas.Helpers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 检测是否有多个屏幕
|
var advanced = MainWindow.Settings.Advanced;
|
||||||
_isMultiScreenMode = ScreenDetectionHelper.HasMultipleScreens();
|
_isMultiScreenMode = advanced.EnableMultiScreenSupport && ScreenDetectionHelper.HasMultipleScreens();
|
||||||
|
_enableScreenSpecificHotkeys = _isMultiScreenMode;
|
||||||
|
|
||||||
if (_isMultiScreenMode)
|
if (_isMultiScreenMode)
|
||||||
{
|
{
|
||||||
// 获取当前窗口所在的屏幕
|
_currentScreen = advanced.FollowMouseForScreenSelection
|
||||||
_currentScreen = ScreenDetectionHelper.GetWindowScreen(_mainWindow);
|
? Screen.FromPoint(Control.MousePosition)
|
||||||
|
: ScreenDetectionHelper.GetWindowScreen(_mainWindow);
|
||||||
|
|
||||||
// 监听窗口位置变化事件
|
// 监听窗口位置变化事件
|
||||||
_mainWindow.LocationChanged += OnWindowLocationChanged;
|
_mainWindow.LocationChanged += OnWindowLocationChanged;
|
||||||
@@ -688,6 +720,9 @@ namespace Ink_Canvas.Helpers
|
|||||||
if (!_isMultiScreenMode || !_enableScreenSpecificHotkeys)
|
if (!_isMultiScreenMode || !_enableScreenSpecificHotkeys)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (MainWindow.Settings.Advanced.FollowMouseForScreenSelection)
|
||||||
|
return;
|
||||||
|
|
||||||
var newScreen = ScreenDetectionHelper.GetWindowScreen(_mainWindow);
|
var newScreen = ScreenDetectionHelper.GetWindowScreen(_mainWindow);
|
||||||
if (newScreen != null && newScreen != _currentScreen)
|
if (newScreen != null && newScreen != _currentScreen)
|
||||||
{
|
{
|
||||||
@@ -800,9 +835,16 @@ namespace Ink_Canvas.Helpers
|
|||||||
if (!_isMultiScreenMode || !_enableScreenSpecificHotkeys)
|
if (!_isMultiScreenMode || !_enableScreenSpecificHotkeys)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 检查鼠标是否在当前窗口所在的屏幕上
|
|
||||||
var mousePosition = Control.MousePosition;
|
var mousePosition = Control.MousePosition;
|
||||||
var currentScreen = Screen.FromPoint(mousePosition);
|
var mouseScreen = Screen.FromPoint(mousePosition);
|
||||||
|
|
||||||
|
if (MainWindow.Settings.Advanced.FollowMouseForScreenSelection &&
|
||||||
|
mouseScreen != null &&
|
||||||
|
mouseScreen != _currentScreen)
|
||||||
|
{
|
||||||
|
_currentScreen = mouseScreen;
|
||||||
|
RefreshHotkeysForCurrentScreen();
|
||||||
|
}
|
||||||
|
|
||||||
// 无论屏幕是否变化,都检查热键状态
|
// 无论屏幕是否变化,都检查热键状态
|
||||||
// 这样可以确保热键状态始终与当前上下文保持一致
|
// 这样可以确保热键状态始终与当前上下文保持一致
|
||||||
|
|||||||
@@ -2547,6 +2547,22 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用多屏设置到全局热键管理器。
|
||||||
|
/// </summary>
|
||||||
|
public void ApplyMultiScreenSettings()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_globalHotkeyManager?.RefreshMultiScreenSettings();
|
||||||
|
RefreshFloatingBarScreenFollowState();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"应用多屏设置时出错: {ex.Message}", LogHelper.LogType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 打开快捷键设置窗口
|
/// 打开快捷键设置窗口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -204,6 +204,10 @@ namespace Ink_Canvas
|
|||||||
/// 用于记录上次在PPT中的坐标
|
/// 用于记录上次在PPT中的坐标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Point pointPPT = new Point(-1, -1);
|
private Point pointPPT = new Point(-1, -1);
|
||||||
|
private DispatcherTimer _floatingBarScreenFollowTimer;
|
||||||
|
private string _lastFloatingBarScreenDeviceName;
|
||||||
|
private string _lastCanvasScreenDeviceName;
|
||||||
|
private bool _isRebuildingCanvasForScreen;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 浮动工具栏移动事件处理
|
/// 浮动工具栏移动事件处理
|
||||||
@@ -1733,8 +1737,7 @@ namespace Ink_Canvas
|
|||||||
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
}
|
}
|
||||||
|
|
||||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
var screen = GetFloatingBarTargetScreen();
|
||||||
var screen = Screen.FromHandle(windowHandle);
|
|
||||||
double screenWidth, screenHeight;
|
double screenWidth, screenHeight;
|
||||||
double toolbarHeight;
|
double toolbarHeight;
|
||||||
if (Settings.Advanced.IsEnableAvoidFullScreenHelper && PosXCaculatedWithTaskbarHeight)
|
if (Settings.Advanced.IsEnableAvoidFullScreenHelper && PosXCaculatedWithTaskbarHeight)
|
||||||
@@ -1889,8 +1892,7 @@ namespace Ink_Canvas
|
|||||||
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
}
|
}
|
||||||
|
|
||||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
var screen = GetFloatingBarTargetScreen();
|
||||||
var screen = Screen.FromHandle(windowHandle);
|
|
||||||
double screenWidth, screenHeight;
|
double screenWidth, screenHeight;
|
||||||
double toolbarHeight;
|
double toolbarHeight;
|
||||||
if (Settings.Advanced.IsEnableAvoidFullScreenHelper)
|
if (Settings.Advanced.IsEnableAvoidFullScreenHelper)
|
||||||
@@ -2008,8 +2010,7 @@ namespace Ink_Canvas
|
|||||||
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
}
|
}
|
||||||
|
|
||||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
var screen = GetFloatingBarTargetScreen();
|
||||||
var screen = Screen.FromHandle(windowHandle);
|
|
||||||
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
||||||
// 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
|
// 仅计算Windows任务栏高度,不考虑其他程序对工作区的影响
|
||||||
var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
|
var toolbarHeight = ForegroundWindowInfo.GetTaskbarHeight(screen, dpiScaleY);
|
||||||
@@ -2104,6 +2105,203 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Screen GetFloatingBarTargetScreen()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Settings.Advanced.EnableMultiScreenSupport &&
|
||||||
|
Settings.Advanced.FollowMouseForScreenSelection &&
|
||||||
|
ScreenDetectionHelper.HasMultipleScreens())
|
||||||
|
{
|
||||||
|
var mouseScreen = Screen.FromPoint(System.Windows.Forms.Control.MousePosition);
|
||||||
|
if (mouseScreen != null)
|
||||||
|
{
|
||||||
|
return mouseScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var windowHandle = new WindowInteropHelper(this).Handle;
|
||||||
|
return Screen.FromHandle(windowHandle);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Screen.PrimaryScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Screen GetCurrentFloatingBarScreen()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (ViewboxFloatingBar == null || !IsLoaded)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var center = ViewboxFloatingBar.PointToScreen(new Point(
|
||||||
|
Math.Max(0, ViewboxFloatingBar.ActualWidth / 2),
|
||||||
|
Math.Max(0, ViewboxFloatingBar.ActualHeight / 2)));
|
||||||
|
return Screen.FromPoint(new System.Drawing.Point((int)center.X, (int)center.Y));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void RefreshFloatingBarScreenFollowState()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var enableFollow = Settings.Advanced.EnableMultiScreenSupport &&
|
||||||
|
Settings.Advanced.FollowMouseForScreenSelection &&
|
||||||
|
ScreenDetectionHelper.HasMultipleScreens();
|
||||||
|
|
||||||
|
if (!enableFollow)
|
||||||
|
{
|
||||||
|
_floatingBarScreenFollowTimer?.Stop();
|
||||||
|
_lastFloatingBarScreenDeviceName = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_floatingBarScreenFollowTimer == null)
|
||||||
|
{
|
||||||
|
_floatingBarScreenFollowTimer = new DispatcherTimer
|
||||||
|
{
|
||||||
|
Interval = TimeSpan.FromMilliseconds(350)
|
||||||
|
};
|
||||||
|
_floatingBarScreenFollowTimer.Tick += FloatingBarScreenFollowTimer_Tick;
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastFloatingBarScreenDeviceName = GetCurrentFloatingBarScreen()?.DeviceName;
|
||||||
|
_lastCanvasScreenDeviceName = _lastFloatingBarScreenDeviceName;
|
||||||
|
|
||||||
|
if (!_floatingBarScreenFollowTimer.IsEnabled)
|
||||||
|
{
|
||||||
|
_floatingBarScreenFollowTimer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"刷新浮动栏多屏跟随状态失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FloatingBarScreenFollowTimer_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!Settings.Advanced.EnableMultiScreenSupport ||
|
||||||
|
!Settings.Advanced.FollowMouseForScreenSelection ||
|
||||||
|
!ScreenDetectionHelper.HasMultipleScreens())
|
||||||
|
{
|
||||||
|
_floatingBarScreenFollowTimer?.Stop();
|
||||||
|
_lastFloatingBarScreenDeviceName = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentMode == 1 || isDragDropInEffect || ViewboxFloatingBar.Visibility != Visibility.Visible)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var mouseScreen = Screen.FromPoint(System.Windows.Forms.Control.MousePosition);
|
||||||
|
var currentFloatingBarScreen = GetCurrentFloatingBarScreen();
|
||||||
|
|
||||||
|
if (mouseScreen == null || currentFloatingBarScreen == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouseScreen.DeviceName == currentFloatingBarScreen.DeviceName)
|
||||||
|
{
|
||||||
|
_lastFloatingBarScreenDeviceName = currentFloatingBarScreen.DeviceName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouseScreen.DeviceName == _lastFloatingBarScreenDeviceName)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastFloatingBarScreenDeviceName = mouseScreen.DeviceName;
|
||||||
|
RebuildCanvasOnTargetScreen(mouseScreen);
|
||||||
|
|
||||||
|
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
|
||||||
|
{
|
||||||
|
PureViewboxFloatingBarMarginAnimationInPPTMode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PureViewboxFloatingBarMarginAnimationInDesktopMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"浮动栏跨屏跟随失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RebuildCanvasOnTargetScreen(Screen targetScreen)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (targetScreen == null || _isRebuildingCanvasForScreen)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_lastCanvasScreenDeviceName == targetScreen.DeviceName)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isRebuildingCanvasForScreen = true;
|
||||||
|
|
||||||
|
double dpiScaleX = 1, dpiScaleY = 1;
|
||||||
|
var source = PresentationSource.FromVisual(this);
|
||||||
|
if (source?.CompositionTarget != null)
|
||||||
|
{
|
||||||
|
dpiScaleX = source.CompositionTarget.TransformToDevice.M11;
|
||||||
|
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先移动主窗口到目标屏,确保画布承载区域切换到新屏幕。
|
||||||
|
MainWindow.MoveWindow(
|
||||||
|
new WindowInteropHelper(this).Handle,
|
||||||
|
targetScreen.Bounds.X,
|
||||||
|
targetScreen.Bounds.Y,
|
||||||
|
targetScreen.Bounds.Width,
|
||||||
|
targetScreen.Bounds.Height,
|
||||||
|
true);
|
||||||
|
|
||||||
|
// 重新铺设画布尺寸,强制触发布局刷新。
|
||||||
|
inkCanvas.Width = targetScreen.Bounds.Width / dpiScaleX;
|
||||||
|
inkCanvas.Height = targetScreen.Bounds.Height / dpiScaleY;
|
||||||
|
inkCanvas.InvalidateMeasure();
|
||||||
|
inkCanvas.InvalidateArrange();
|
||||||
|
inkCanvas.UpdateLayout();
|
||||||
|
|
||||||
|
if (GridInkCanvasSelectionCover != null)
|
||||||
|
{
|
||||||
|
GridInkCanvasSelectionCover.Width = inkCanvas.Width;
|
||||||
|
GridInkCanvasSelectionCover.Height = inkCanvas.Height;
|
||||||
|
GridInkCanvasSelectionCover.InvalidateMeasure();
|
||||||
|
GridInkCanvasSelectionCover.InvalidateArrange();
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastCanvasScreenDeviceName = targetScreen.DeviceName;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"在新屏重建画布失败: {ex.Message}", LogHelper.LogType.Warning);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
_isRebuildingCanvasForScreen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 光标图标点击事件处理
|
/// 光标图标点击事件处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -823,6 +823,8 @@ namespace Ink_Canvas
|
|||||||
Settings.Advanced.IsEnableForceFullScreen = false;
|
Settings.Advanced.IsEnableForceFullScreen = false;
|
||||||
Settings.Advanced.IsEnableDPIChangeDetection = false;
|
Settings.Advanced.IsEnableDPIChangeDetection = false;
|
||||||
Settings.Advanced.IsEnableResolutionChangeDetection = false;
|
Settings.Advanced.IsEnableResolutionChangeDetection = false;
|
||||||
|
Settings.Advanced.EnableMultiScreenSupport = true;
|
||||||
|
Settings.Advanced.FollowMouseForScreenSelection = true;
|
||||||
|
|
||||||
Settings.Appearance.IsEnableDisPlayNibModeToggler = false;
|
Settings.Appearance.IsEnableDisPlayNibModeToggler = false;
|
||||||
Settings.Appearance.IsColorfulViewboxFloatingBar = false;
|
Settings.Appearance.IsColorfulViewboxFloatingBar = false;
|
||||||
|
|||||||
@@ -618,6 +618,8 @@ namespace Ink_Canvas
|
|||||||
ViewboxFloatingBarMarginAnimation(100, true);
|
ViewboxFloatingBarMarginAnimation(100, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RefreshFloatingBarScreenFollowState();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -731,6 +731,12 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
[JsonProperty("windowMode")]
|
[JsonProperty("windowMode")]
|
||||||
public bool WindowMode { get; set; } = true;
|
public bool WindowMode { get; set; } = true;
|
||||||
|
|
||||||
|
[JsonProperty("enableMultiScreenSupport")]
|
||||||
|
public bool EnableMultiScreenSupport { get; set; } = true;
|
||||||
|
|
||||||
|
[JsonProperty("followMouseForScreenSelection")]
|
||||||
|
public bool FollowMouseForScreenSelection { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InkToShape
|
public class InkToShape
|
||||||
|
|||||||
@@ -57,6 +57,21 @@
|
|||||||
SwitchName="ToggleSwitchAvoidFullScreen"
|
SwitchName="ToggleSwitchAvoidFullScreen"
|
||||||
Toggled="ToggleSwitchAvoidFullScreen_Toggled" />
|
Toggled="ToggleSwitchAvoidFullScreen_Toggled" />
|
||||||
|
|
||||||
|
<controls:LabeledSettingsCard x:Name="CardMultiScreenSupport"
|
||||||
|
Header="多屏支持"
|
||||||
|
Description="启用后将根据当前显示器环境启用多屏逻辑"
|
||||||
|
Icon="{x:Static ui:SegoeFluentIcons.BackToWindow}"
|
||||||
|
SwitchName="ToggleSwitchMultiScreenSupport"
|
||||||
|
Toggled="ToggleSwitchMultiScreenSupport_Toggled" />
|
||||||
|
|
||||||
|
<controls:LabeledSettingsCard x:Name="CardFollowMouseScreen"
|
||||||
|
Header="自动跟随鼠标选择显示屏"
|
||||||
|
Description="默认开启:自动以鼠标所在显示屏作为当前目标显示屏"
|
||||||
|
Icon="{x:Static ui:SegoeFluentIcons.TouchPointer}"
|
||||||
|
Visibility="{Binding IsOn, ElementName=CardMultiScreenSupport, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||||
|
SwitchName="ToggleSwitchFollowMouseScreen"
|
||||||
|
Toggled="ToggleSwitchFollowMouseScreen_Toggled" />
|
||||||
|
|
||||||
<ui:SettingsExpander x:Name="ExpanderAlwaysOnTop"
|
<ui:SettingsExpander x:Name="ExpanderAlwaysOnTop"
|
||||||
Header="{i18n:I18n Key=Startup_TopMost}"
|
Header="{i18n:I18n Key=Startup_TopMost}"
|
||||||
Description="{i18n:I18n Key=Startup_TopMostHint}"
|
Description="{i18n:I18n Key=Startup_TopMostHint}"
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
|||||||
CardNoFocusMode.IsOn = settings.Advanced.IsNoFocusMode;
|
CardNoFocusMode.IsOn = settings.Advanced.IsNoFocusMode;
|
||||||
CardWindowMode.IsOn = settings.Advanced.WindowMode;
|
CardWindowMode.IsOn = settings.Advanced.WindowMode;
|
||||||
CardAvoidFullScreen.IsOn = settings.Advanced.IsEnableAvoidFullScreenHelper;
|
CardAvoidFullScreen.IsOn = settings.Advanced.IsEnableAvoidFullScreenHelper;
|
||||||
|
CardMultiScreenSupport.IsOn = settings.Advanced.EnableMultiScreenSupport;
|
||||||
|
CardFollowMouseScreen.IsOn = settings.Advanced.FollowMouseForScreenSelection;
|
||||||
ToggleSwitchAlwaysOnTop.IsOn = settings.Advanced.IsAlwaysOnTop;
|
ToggleSwitchAlwaysOnTop.IsOn = settings.Advanced.IsAlwaysOnTop;
|
||||||
|
|
||||||
_topMostModeItems.Clear();
|
_topMostModeItems.Clear();
|
||||||
@@ -215,6 +217,48 @@ namespace Ink_Canvas.Windows.SettingsViews.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleSwitchMultiScreenSupport_Toggled(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!_isLoaded) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool newState = CardMultiScreenSupport.IsOn;
|
||||||
|
SettingsManager.Settings.Advanced.EnableMultiScreenSupport = newState;
|
||||||
|
SettingsManager.SaveSettingsToFile();
|
||||||
|
|
||||||
|
if (Application.Current.MainWindow is MainWindow mainWindow)
|
||||||
|
{
|
||||||
|
mainWindow.ApplyMultiScreenSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"设置多屏支持时出错: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToggleSwitchFollowMouseScreen_Toggled(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!_isLoaded) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool newState = CardFollowMouseScreen.IsOn;
|
||||||
|
SettingsManager.Settings.Advanced.FollowMouseForScreenSelection = newState;
|
||||||
|
SettingsManager.SaveSettingsToFile();
|
||||||
|
|
||||||
|
if (Application.Current.MainWindow is MainWindow mainWindow)
|
||||||
|
{
|
||||||
|
mainWindow.ApplyMultiScreenSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine($"设置自动跟随鼠标选择显示屏时出错: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void RadioTopMostNormal_Checked(object sender, RoutedEventArgs e)
|
private void RadioTopMostNormal_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!_isLoaded) return;
|
if (!_isLoaded) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user