diff --git a/Ink Canvas/Controls/Popups/BackgroundPalettePopupContent.xaml b/Ink Canvas/Controls/Popups/BackgroundPalettePopupContent.xaml index cb66224f..3d903a98 100644 --- a/Ink Canvas/Controls/Popups/BackgroundPalettePopupContent.xaml +++ b/Ink Canvas/Controls/Popups/BackgroundPalettePopupContent.xaml @@ -15,22 +15,33 @@ Foreground="{DynamicResource TextForeground}" FontSize="10" FontWeight="Bold" HorizontalAlignment="Center"/> - + - + + + diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index b4892f97..e1833a5b 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -175,6 +175,7 @@ private void WireUpBackgroundPaletteEvents() var content = BackgroundPalettePopupContent; content.WhiteboardBtn.MouseUp += WhiteboardModeBtn_MouseUp; content.BlackboardBtn.MouseUp += BlackboardModeBtn_MouseUp; + content.BlackModeBtn.MouseUp += BlackModeBtn_MouseUp; content.RSlider.ValueChanged += BackgroundRSlider_ValueChanged; content.GSlider.ValueChanged += BackgroundGSlider_ValueChanged; content.BSlider.ValueChanged += BackgroundBSlider_ValueChanged; diff --git a/Ink Canvas/MainWindow_cs/MW_BoardIcons.cs b/Ink Canvas/MainWindow_cs/MW_BoardIcons.cs index e3f0ced9..03fd0f17 100644 --- a/Ink Canvas/MainWindow_cs/MW_BoardIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_BoardIcons.cs @@ -23,21 +23,26 @@ public partial class MainWindow : Ink_Canvas.Helpers.PerformanceTransparentWin /// - 处理白板/黑板模式切换 /// - 更新背景颜色和墨迹颜色 /// + private int currentBackgroundMode = 0; // 0: 白板, 1: 黑板(深绿), 2: 纯黑 + private void BoardChangeBackgroundColorBtn_MouseUp(object sender, RoutedEventArgs e) { if (!isLoaded) return; - if (BackgroundPalette.IsOpen) - { - AnimationsHelper.HidePopupWithSlideAndFade(BackgroundPalette); - } - else + // 循环切换背景模式 + currentBackgroundMode = (currentBackgroundMode + 1) % 3; + + switch (currentBackgroundMode) { - HideSubPanels(); - LoadCustomBackgroundColor(); - UpdateBackgroundButtonsState(); - AnimationsHelper.ShowPopupWithSlideAndFade(BackgroundPalette); - _popupManager?.BringToFront(BackgroundPalette); + case 0: // 白板 + WhiteboardModeBtn_MouseUp(sender, null); + break; + case 1: // 黑板(深绿) + BlackboardModeBtn_MouseUp(sender, null); + break; + case 2: // 纯黑 + BlackModeBtn_MouseUp(sender, null); + break; } } @@ -91,6 +96,31 @@ private void BlackboardModeBtn_MouseUp(object sender, MouseButtonEventArgs e) UpdateBackgroundButtonsState(); } + private void BlackModeBtn_MouseUp(object sender, MouseButtonEventArgs e) + { + Settings.Canvas.UsingWhiteboard = false; + SaveSettingsToFile(); + ICCWaterMarkWhite.Visibility = Visibility.Visible; + ICCWaterMarkDark.Visibility = Visibility.Collapsed; + + Color defaultBlackColor = Color.FromRgb(0, 0, 0); + + if (currentMode == 1) + { + GridBackgroundCover.Background = new SolidColorBrush(defaultBlackColor); + UpdateRGBSliders(defaultBlackColor); + CustomBackgroundColor = defaultBlackColor; + string colorHex = $"#{defaultBlackColor.R:X2}{defaultBlackColor.G:X2}{defaultBlackColor.B:X2}"; + Settings.Canvas.CustomBackgroundColor = colorHex; + SaveSettingsToFile(); + } + + CheckLastColor(5); + forceEraser = false; + CheckColorTheme(true); + UpdateBackgroundButtonsState(); + } + private void BackgroundRSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { if (BackgroundRValue != null)