From 9eb70de1bce894e3985cbbb8aa9439fac7b82ce2 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Mon, 23 Feb 2026 13:20:52 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E5=B1=95=E5=8F=B0UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml | 88 +++++++++++++++++++++-------------- Ink Canvas/MainWindow.xaml.cs | 60 ++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 34 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index 43addfb2..f6ed04a3 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -4973,7 +4973,7 @@ - + - + - + @@ -10627,71 +10627,91 @@ - + + + + + - + - + - + + + + + + + + + + + + + + + diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 37c68229..dcc5b113 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -71,6 +71,11 @@ namespace Ink_Canvas // 全屏处理状态标志 public bool isFullScreenApplied = false; + private int _boothResolutionWidth = 1920; + private int _boothResolutionHeight = 1080; + public int BoothResolutionWidth => _boothResolutionWidth; + public int BoothResolutionHeight => _boothResolutionHeight; + private static Cursor _cachedPenCursor = null; private static readonly object _cursorLock = new object(); @@ -3377,6 +3382,61 @@ namespace Ink_Canvas } #endregion + #region 展台/白板分辨率切换 + private const int BoothResolutionTabCount = 4; + private static readonly (int w, int h)[] BoothResolutionValues = { (1280, 720), (1920, 1080), (2560, 1440), (3840, 2160) }; + + private void BoothResolutionTab_Click(object sender, RoutedEventArgs e) + { + if (sender is Button btn && btn.Tag is string tag) + { + var parts = tag.Split(','); + if (parts.Length == 2 && int.TryParse(parts[0].Trim(), out int w) && int.TryParse(parts[1].Trim(), out int h) && w > 0 && h > 0) + { + _boothResolutionWidth = w; + _boothResolutionHeight = h; + UpdateBoothResolutionTabState(); + } + } + } + + private void UpdateBoothResolutionTabState() + { + int index = 0; + for (int i = 0; i < BoothResolutionValues.Length; i++) + { + if (BoothResolutionValues[i].w == _boothResolutionWidth && BoothResolutionValues[i].h == _boothResolutionHeight) + { + index = i; + break; + } + } + + if (BoothResolutionTabIndicator != null) + { + BoothResolutionTabIndicator.Margin = new Thickness(1 + index * 70, 0, 0, 0); + } + + var texts = new[] { BtnBoothResolution720?.Content as TextBlock, BtnBoothResolution1080?.Content as TextBlock, BtnBoothResolution2K?.Content as TextBlock, BtnBoothResolution4K?.Content as TextBlock }; + for (int i = 0; i < texts.Length && i < 4; i++) + { + if (texts[i] == null) continue; + if (i == index) + { + texts[i].FontWeight = FontWeights.Bold; + texts[i].Foreground = new SolidColorBrush(Colors.White); + texts[i].Opacity = 1.0; + } + else + { + texts[i].FontWeight = FontWeights.SemiBold; + texts[i].SetResourceReference(TextBlock.ForegroundProperty, "FloatBarForeground"); + texts[i].Opacity = 0.7; + } + } + } + #endregion + #region 墨迹渐隐功能 /// /// 墨迹渐隐开关切换事件处理