Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions Ink Canvas/Controls/Popups/BackgroundPalettePopupContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,33 @@
Foreground="{DynamicResource TextForeground}"
FontSize="10" FontWeight="Bold"
HorizontalAlignment="Center"/>
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="20">
<ikw:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10">
<Border x:Name="WhiteboardModeBtn"
Width="60" Height="30"
Width="50" Height="30"
Background="#2563eb"
CornerRadius="4">
<TextBlock Text="白板" FontSize="10"
<TextBlock Text="白板" FontSize="9"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
<Border x:Name="BlackboardModeBtn"
Width="60" Height="30"
Background="LightGray"
Width="50" Height="30"
Background="#162924"
CornerRadius="4">
<TextBlock Text="黑板"
Foreground="Black"
Foreground="White"
FontSize="9"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
<Border x:Name="BlackModeBtn"
Width="50" Height="30"
Background="Black"
CornerRadius="4">
<TextBlock Text="纯黑"
Foreground="White"
FontSize="9"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>
Expand Down
1 change: 1 addition & 0 deletions Ink Canvas/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
50 changes: 40 additions & 10 deletions Ink Canvas/MainWindow_cs/MW_BoardIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ public partial class MainWindow : Ink_Canvas.Helpers.PerformanceTransparentWin
/// - 处理白板/黑板模式切换
/// - 更新背景颜色和墨迹颜色
/// </remarks>
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;
}
}

Expand Down Expand Up @@ -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<double> e)
{
if (BackgroundRValue != null)
Expand Down
Loading