[update] 白板多背景色初步可用,修复白板模式下PPT放映的问题,墨迹重播优化,其他微型优化和修复

This commit is contained in:
Dubi906w 2024-07-12 21:33:36 +08:00
parent 693528d679
commit 82068dac5e
10 changed files with 892 additions and 522 deletions

View File

@ -20,7 +20,7 @@
Closing="Window_Closing"
Closed="Window_Closed"
PreviewKeyDown="Main_Grid_PreviewKeyDown"
Height="9000" Width="1440"
Height="12000" Width="1440"
FontFamily="Microsoft YaHei UI"
MouseWheel="Window_MouseWheel"
Foreground="Black"
@ -661,7 +661,7 @@
</Border>
<Grid Width="0" Margin="0,0,0,5">
<Border ClipToBounds="True" Name="BoardBackgroundPopup"
Margin="-134,-221,-51,50"
Margin="-134,-278,-51,50"
CornerRadius="8"
Background="#fafafa" Opacity="1" BorderBrush="#2563eb"
BorderThickness="1">
@ -684,11 +684,11 @@
Margin="0,5,0,0">
<Border Width="46" Height="46" CornerRadius="4"
Background="#27272a" BorderBrush="#18181b"
BorderThickness="1">
BorderThickness="1" MouseUp="BoardBackgroundColor1Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4"
Width="14" Height="14">
<CheckBox IsHitTestVisible="False"
<CheckBox IsHitTestVisible="False" Name="BoardBackgroundColor1Checkbox"
IsTabStop="False" IsChecked="True"
MinWidth="0" Padding="0" MinHeight="0">
</CheckBox>
@ -699,10 +699,10 @@
</Border>
<Border Width="46" Height="46" CornerRadius="4"
Background="#172a25" BorderBrush="#052e16"
BorderThickness="1">
BorderThickness="1" MouseUp="BoardBackgroundColor2Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4"
Width="14" Height="14"
Width="14" Height="14" Name="BoardBackgroundColor2Checkbox"
Visibility="Collapsed">
<CheckBox IsHitTestVisible="False"
IsTabStop="False" IsChecked="True"
@ -715,10 +715,10 @@
</Border>
<Border Width="46" Height="46" CornerRadius="4"
Background="#eaebed" BorderBrush="#a1a1aa"
BorderThickness="1">
BorderThickness="1" MouseUp="BoardBackgroundColor3Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4"
Width="14" Height="14"
Width="14" Height="14" Name="BoardBackgroundColor3Checkbox"
Visibility="Collapsed">
<CheckBox IsHitTestVisible="False"
IsTabStop="False" IsChecked="True"
@ -730,6 +730,56 @@
</Canvas>
</Border>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Spacing="4" Orientation="Horizontal"
Margin="0,5,0,0">
<Border Width="46" Height="46" CornerRadius="4"
Background="#0f172a" BorderBrush="#020617"
BorderThickness="1" MouseUp="BoardBackgroundColor4Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4" Name="BoardBackgroundColor4Checkbox"
Width="14" Height="14" Visibility="Collapsed">
<CheckBox IsHitTestVisible="False"
IsTabStop="False" IsChecked="True"
MinWidth="0" Padding="0" MinHeight="0">
</CheckBox>
</Viewbox>
<TextBlock Canvas.Bottom="4" Canvas.Left="4"
FontSize="10" Foreground="White" Text="蓝黑" />
</Canvas>
</Border>
<Border Width="46" Height="46" CornerRadius="4"
Background="#B5E6B5" BorderBrush="#059669"
BorderThickness="1" MouseUp="BoardBackgroundColor5Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4"
Width="14" Height="14" Name="BoardBackgroundColor5Checkbox"
Visibility="Collapsed">
<CheckBox IsHitTestVisible="False"
IsTabStop="False" IsChecked="True"
MinWidth="0" Padding="0" MinHeight="0">
</CheckBox>
</Viewbox>
<TextBlock Canvas.Bottom="4" Canvas.Left="4"
FontSize="10" Foreground="#18181b" Text="护眼绿" />
</Canvas>
</Border>
<Border Width="46" Height="46" CornerRadius="4"
Background="Black" BorderBrush="#52525b"
BorderThickness="1" MouseUp="BoardBackgroundColor6Border_MouseUp">
<Canvas>
<Viewbox Canvas.Right="4" Canvas.Top="4"
Width="14" Height="14" Name="BoardBackgroundColor6Checkbox"
Visibility="Collapsed">
<CheckBox IsHitTestVisible="False"
IsTabStop="False" IsChecked="True"
MinWidth="0" Padding="0" MinHeight="0">
</CheckBox>
</Viewbox>
<TextBlock Canvas.Bottom="4" Canvas.Left="4"
FontSize="10" Foreground="White" Text="纯黑" />
</Canvas>
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Margin="12,2,12,0">
<TextBlock FontSize="12" Foreground="#18181b" Text="稿纸格式" />
@ -5298,9 +5348,9 @@
</Viewbox>
<!--// 设置界面 //-->
<Grid d:IsHidden="True" x:Name="BorderSettingsMask" IsHitTestVisible="True"
<Grid d:IsHidden="False" x:Name="BorderSettingsMask" IsHitTestVisible="True"
Margin="0,0,0,0">
<Border Name="SettingsOverlay" MouseDown="SettingsOverlayClick"></Border>
<Border Name="SettingsOverlay" MouseDown="SettingsOverlayClick" d:IsHidden="True"></Border>
<Border Name="BorderSettings" Background="#ee18181b" ui:ThemeManager.RequestedTheme="Dark" Width="490"
HorizontalAlignment="Left" Margin="300,150,0,350" Visibility="Visible">
<Grid>
@ -5517,6 +5567,132 @@
</ComboBox>
</ui:SimpleStackPanel>
<TextBlock Text="# 非实时切换,下一次使用面积擦时生效。" TextWrapping="Wrap" Foreground="#a1a1aa" />
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
StrokeThickness="1" Margin="0,4,0,4" />
<TextBlock Margin="0,0,0,8" Text="白板背景" FontWeight="Bold" Foreground="#fafafa"
FontSize="20" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="白板模式默认背景色" VerticalAlignment="Center"
FontSize="14" Margin="0,0,6,0" />
<Border Height="20" CornerRadius="3" Background="#1e3a8a" Margin="0,0,12,0"
Padding="4,0">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="3"
VerticalAlignment="Center">
<Image Width="16" Height="16" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#dbeafe"
Geometry="F0 M24,24z M0,0z M18.75,4C18.75,3.58579 18.4142,3.25 18,3.25 17.5858,3.25 17.25,3.58579 17.25,4 17.25,4.33152 17.1183,4.64946 16.8839,4.88388 16.6495,5.1183 16.3315,5.25 16,5.25 15.5858,5.25 15.25,5.58579 15.25,6 15.25,6.41421 15.5858,6.75 16,6.75 16.3315,6.75 16.6495,6.8817 16.8839,7.11612 17.1183,7.35054 17.25,7.66848 17.25,8 17.25,8.41421 17.5858,8.75 18,8.75 18.4142,8.75 18.75,8.41421 18.75,8 18.75,7.66848 18.8817,7.35054 19.1161,7.11612 19.3505,6.8817 19.6685,6.75 20,6.75 20.4142,6.75 20.75,6.41421 20.75,6 20.75,5.58579 20.4142,5.25 20,5.25 19.6685,5.25 19.3505,5.1183 19.1161,4.88388 18.8817,4.64946 18.75,4.33152 18.75,4z M9.75,6C9.75,5.58579 9.41421,5.25 9,5.25 8.58579,5.25 8.25,5.58579 8.25,6 8.25,7.39239 7.69688,8.72774 6.71231,9.71231 5.72774,10.6969 4.39239,11.25 3,11.25 2.58579,11.25 2.25,11.5858 2.25,12 2.25,12.4142 2.58579,12.75 3,12.75 4.39239,12.75 5.72774,13.3031 6.71231,14.2877 7.69688,15.2723 8.25,16.6076 8.25,18 8.25,18.4142 8.58579,18.75 9,18.75 9.41421,18.75 9.75,18.4142 9.75,18 9.75,16.6076 10.3031,15.2723 11.2877,14.2877 12.2723,13.3031 13.6076,12.75 15,12.75 15.4142,12.75 15.75,12.4142 15.75,12 15.75,11.5858 15.4142,11.25 15,11.25 13.6076,11.25 12.2723,10.6969 11.2877,9.71231 10.3031,8.72774 9.75,7.39239 9.75,6z M18.75,16C18.75,15.5858 18.4142,15.25 18,15.25 17.5858,15.25 17.25,15.5858 17.25,16 17.25,16.3315 17.1183,16.6495 16.8839,16.8839 16.6495,17.1183 16.3315,17.25 16,17.25 15.5858,17.25 15.25,17.5858 15.25,18 15.25,18.4142 15.5858,18.75 16,18.75 16.3315,18.75 16.6495,18.8817 16.8839,19.1161 17.1183,19.3505 17.25,19.6685 17.25,20 17.25,20.4142 17.5858,20.75 18,20.75 18.4142,20.75 18.75,20.4142 18.75,20 18.75,19.6685 18.8817,19.3505 19.1161,19.1161 19.3505,18.8817 19.6685,18.75 20,18.75 20.4142,18.75 20.75,18.4142 20.75,18 20.75,17.5858 20.4142,17.25 20,17.25 19.6685,17.25 19.3505,17.1183 19.1161,16.8839 18.8817,16.6495 18.75,16.3315 18.75,16z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#dbeafe" Text="新功能" FontSize="12"
VerticalAlignment="Center">
</TextBlock>
</ui:SimpleStackPanel>
</Border>
<ComboBox Name="ComboBoxBlackboardBackgroundColor" FontFamily="Microsoft YaHei UI"
SelectedIndex="2"
SelectionChanged="ComboBoxBlackboardBackgroundColor_SelectionChanged">
<ComboBoxItem HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="3" Margin="0,0,6,0" Width="16" Height="16" Background="#27272a" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">灰黑</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" BorderBrush="#16a34a" BorderThickness="1" CornerRadius="3" Margin="0,0,6,0" Width="16" Height="16" Background="#172a25" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">黑板绿</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" CornerRadius="3" BorderBrush="White" BorderThickness="1" Margin="0,0,6,0" Width="16" Height="16" Background="#eaebed" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">白色</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" CornerRadius="3" BorderBrush="#a1a1aa" BorderThickness="1" Margin="0,0,6,0" Width="16" Height="16" Background="#0f172a" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">蓝黑</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" CornerRadius="3" BorderBrush="#4ade80" BorderThickness="1" Margin="0,0,6,0" Width="16" Height="16" Background="#B5E6B5" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">护眼绿</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Width="78">
<Border VerticalAlignment="Center" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="3" Margin="0,0,6,0" Width="16" Height="16" Background="Black" />
<TextBlock VerticalAlignment="Center" FontFamily="Microsoft YaHei UI">纯黑</TextBlock>
</StackPanel>
</ComboBoxItem>
</ComboBox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="白板模式默认背景稿纸格式" VerticalAlignment="Center"
FontSize="14" Margin="0,0,6,0" />
<Border Height="20" CornerRadius="3" Background="#1e3a8a" Margin="0,0,12,0"
Padding="4,0">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="3"
VerticalAlignment="Center">
<Image Width="16" Height="16" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#dbeafe"
Geometry="F0 M24,24z M0,0z M18.75,4C18.75,3.58579 18.4142,3.25 18,3.25 17.5858,3.25 17.25,3.58579 17.25,4 17.25,4.33152 17.1183,4.64946 16.8839,4.88388 16.6495,5.1183 16.3315,5.25 16,5.25 15.5858,5.25 15.25,5.58579 15.25,6 15.25,6.41421 15.5858,6.75 16,6.75 16.3315,6.75 16.6495,6.8817 16.8839,7.11612 17.1183,7.35054 17.25,7.66848 17.25,8 17.25,8.41421 17.5858,8.75 18,8.75 18.4142,8.75 18.75,8.41421 18.75,8 18.75,7.66848 18.8817,7.35054 19.1161,7.11612 19.3505,6.8817 19.6685,6.75 20,6.75 20.4142,6.75 20.75,6.41421 20.75,6 20.75,5.58579 20.4142,5.25 20,5.25 19.6685,5.25 19.3505,5.1183 19.1161,4.88388 18.8817,4.64946 18.75,4.33152 18.75,4z M9.75,6C9.75,5.58579 9.41421,5.25 9,5.25 8.58579,5.25 8.25,5.58579 8.25,6 8.25,7.39239 7.69688,8.72774 6.71231,9.71231 5.72774,10.6969 4.39239,11.25 3,11.25 2.58579,11.25 2.25,11.5858 2.25,12 2.25,12.4142 2.58579,12.75 3,12.75 4.39239,12.75 5.72774,13.3031 6.71231,14.2877 7.69688,15.2723 8.25,16.6076 8.25,18 8.25,18.4142 8.58579,18.75 9,18.75 9.41421,18.75 9.75,18.4142 9.75,18 9.75,16.6076 10.3031,15.2723 11.2877,14.2877 12.2723,13.3031 13.6076,12.75 15,12.75 15.4142,12.75 15.75,12.4142 15.75,12 15.75,11.5858 15.4142,11.25 15,11.25 13.6076,11.25 12.2723,10.6969 11.2877,9.71231 10.3031,8.72774 9.75,7.39239 9.75,6z M18.75,16C18.75,15.5858 18.4142,15.25 18,15.25 17.5858,15.25 17.25,15.5858 17.25,16 17.25,16.3315 17.1183,16.6495 16.8839,16.8839 16.6495,17.1183 16.3315,17.25 16,17.25 15.5858,17.25 15.25,17.5858 15.25,18 15.25,18.4142 15.5858,18.75 16,18.75 16.3315,18.75 16.6495,18.8817 16.8839,19.1161 17.1183,19.3505 17.25,19.6685 17.25,20 17.25,20.4142 17.5858,20.75 18,20.75 18.4142,20.75 18.75,20.4142 18.75,20 18.75,19.6685 18.8817,19.3505 19.1161,19.1161 19.3505,18.8817 19.6685,18.75 20,18.75 20.4142,18.75 20.75,18.4142 20.75,18 20.75,17.5858 20.4142,17.25 20,17.25 19.6685,17.25 19.3505,17.1183 19.1161,16.8839 18.8817,16.6495 18.75,16.3315 18.75,16z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#dbeafe" Text="新功能" FontSize="12"
VerticalAlignment="Center">
</TextBlock>
</ui:SimpleStackPanel>
</Border>
<ComboBox Name="ComboBoxBlackboardBackgroundPattern" FontFamily="Microsoft YaHei UI"
SelectedIndex="0"
SelectionChanged="ComboBoxBlackboardBackgroundPattern_SelectionChanged">
<ComboBoxItem Content="无" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="点" FontFamily="Microsoft YaHei UI" />
<ComboBoxItem Content="网格" FontFamily="Microsoft YaHei UI" />
</ComboBox>
</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="ToggleSwitchUseDefaultBackgroundColorForEveryNewAddedBlackboardPage"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchUseDefaultBackgroundColorForEveryNewAddedBlackboardPage_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="ToggleSwitchUseDefaultBackgroundPatternForEveryNewAddedBlackboardPage"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchUseDefaultBackgroundPatternForEveryNewAddedBlackboardPage_Toggled" />
</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" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchIsEnableAutoConvertInkColorWhenBackgroundChanged"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchIsEnableAutoConvertInkColorWhenBackgroundChanged_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后,每次在白板模式下如果更换为暗色背景,则会将所有暗色墨迹转换为亮色墨迹,同理,如果更换为亮色背景,则会将所有亮色墨迹转换为暗色墨迹(自定义颜色不支持转换)"
TextWrapping="Wrap" Foreground="#a1a1aa" />
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
StrokeThickness="1" Margin="0,4,0,4" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
@ -5550,7 +5726,7 @@
<ComboBoxItem Content="每次询问" FontFamily="Microsoft YaHei UI" />
</ComboBox>
</ui:SimpleStackPanel>
<TextBlock Text="# 请注意,若不保留双曲线渐近线可能会有遇到撤回相关的 BUG 影响用。" TextWrapping="Wrap"
<TextBlock Text="# Ink Canvas祖传Bug。请注意,若不保留双曲线渐近线可能会有遇到撤回相关的 BUG 影响使用。" TextWrapping="Wrap"
Foreground="#a1a1aa" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="让墨迹使用贝塞尔曲线平滑处理"
@ -5880,6 +6056,13 @@
</Canvas>
</GroupBox.Header>
<ui:SimpleStackPanel Spacing="6">
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="浮动工具栏显示按钮文字"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchFloatingBarButtonLabelVisibility" IsOn="True"
FontFamily="Microsoft YaHei UI" FontWeight="Bold"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="浮动工具栏图标" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
@ -7903,14 +8086,23 @@
</Canvas>
</Grid>
<Grid Controls:Panel.ZIndex="999" Height="90" VerticalAlignment="Bottom">
<Grid.Background>
<Border Height="90" IsHitTestVisible="False">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#00000000" Offset="0.0"/>
<GradientStop Color="#FF000000" Offset="1.0"/>
<GradientStop Color="#00000000" Offset="0.0" />
<GradientStop Color="#FF000000" Offset="1.0" />
</LinearGradientBrush>
</Grid.Background>
<Image MouseDown="BtnSettings_Click" MouseEnter="SettingsPaneBackBtn_MouseEnter" MouseLeave="SettingsPaneBackBtn_MouseLeave" Height="70" Source="/Resources/Icons-png/menu-back.png" Margin="-10,20,0,0" HorizontalAlignment="Left"></Image>
<Image Name="SettingsPaneBackBtnHighlight" IsHitTestVisible="False" Height="70" Source="/Resources/Icons-png/menu-back-highlighted.png" Margin="-10,20,0,0" HorizontalAlignment="Left" Opacity="0"></Image>
</Border.Background>
</Border>
<Image IsHitTestVisible="True" MouseDown="BtnSettings_Click"
MouseEnter="SettingsPaneBackBtn_MouseEnter" MouseLeave="SettingsPaneBackBtn_MouseLeave"
Height="70" Source="/Resources/Icons-png/menu-back.png" Margin="-10,20,0,0"
HorizontalAlignment="Left">
</Image>
<Image Name="SettingsPaneBackBtnHighlight" IsHitTestVisible="False" Height="70"
Source="/Resources/Icons-png/menu-back-highlighted.png" Margin="-10,20,0,0"
HorizontalAlignment="Left" Opacity="0">
</Image>
</Grid>
</Grid>
</Border>

View File

@ -201,6 +201,7 @@ namespace Ink_Canvas {
BtnWhiteBoardSwitchPrevious.IsEnabled = CurrentWhiteboardIndex != 1;
BorderInkReplayToolBox.Visibility = Visibility.Collapsed;
BoardBackgroundPopup.Visibility = Visibility.Collapsed;
// 提前加载IA库优化第一笔等待时间
if (Settings.InkToShape.IsInkToShapeEnabled && !Environment.Is64BitProcess) {

View File

@ -1,5 +1,6 @@
using Ink_Canvas.Helpers;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
@ -19,10 +20,95 @@ namespace Ink_Canvas {
private bool[] whiteboadLastModeIsRedo = new bool[101];
private StrokeCollection lastTouchDownStrokeCollection = new StrokeCollection();
private int CurrentWhiteboardIndex = 1;
private int WhiteboardTotalCount = 1;
public int CurrentWhiteboardIndex = 1;
public int WhiteboardTotalCount = 1;
private TimeMachineHistory[][] TimeMachineHistories = new TimeMachineHistory[101][]; //最多99页0用来存储非白板时的墨迹以便还原
public Color[] BoardBackgroundColors = new Color[6] {
Color.FromRgb(39, 39, 42),
Color.FromRgb(23, 42, 37),
Color.FromRgb(234, 235, 237),
Color.FromRgb(15, 23, 42),
Color.FromRgb(181, 230, 181),
Color.FromRgb(0, 0, 0)
};
public class BoardPageSettings {
public BlackboardBackgroundColorEnum BackgroundColor { get; set; } = BlackboardBackgroundColorEnum.White;
public BlackboardBackgroundPatternEnum BackgroundPattern { get; set; } = BlackboardBackgroundPatternEnum.None;
}
public List<BoardPageSettings> BoardPagesSettingsList = new List<BoardPageSettings>() {
new BoardPageSettings()
};
#region Board Background
private void ChangeBoardBackground(int id) {
BoardPagesSettingsList[CurrentWhiteboardIndex - 1].BackgroundColor = (BlackboardBackgroundColorEnum)id;
var bgC = BoardPagesSettingsList[CurrentWhiteboardIndex - 1].BackgroundColor;
if (bgC == BlackboardBackgroundColorEnum.BlackBoardGreen
|| bgC == BlackboardBackgroundColorEnum.BlueBlack
|| bgC == BlackboardBackgroundColorEnum.GrayBlack
|| bgC == BlackboardBackgroundColorEnum.RealBlack)
{
if (inkColor == 0) lastBoardInkColor = 5;
}
else
{
if (inkColor == 5) lastBoardInkColor = 0;
}
CheckColorTheme(true);
UpdateBoardBackgroundPanelDisplayStatus();
}
private void BoardBackgroundColor1Border_MouseUp(object sender, MouseButtonEventArgs e) {
ChangeBoardBackground(0);
}
private void BoardBackgroundColor2Border_MouseUp(object sender, MouseButtonEventArgs e) {
ChangeBoardBackground(1);
}
private void BoardBackgroundColor3Border_MouseUp(object sender, MouseButtonEventArgs e) {
ChangeBoardBackground(2);
}
private void BoardBackgroundColor4Border_MouseUp(object sender, MouseButtonEventArgs e) {
ChangeBoardBackground(3);
}
private void BoardBackgroundColor5Border_MouseUp(object sender, MouseButtonEventArgs e) {
ChangeBoardBackground(4);
}
private void BoardBackgroundColor6Border_MouseUp(object sender, MouseButtonEventArgs e)
{
ChangeBoardBackground(5);
}
private void UpdateBoardBackgroundPanelDisplayStatus() {
BoardBackgroundColor1Checkbox.Visibility = Visibility.Collapsed;
BoardBackgroundColor2Checkbox.Visibility = Visibility.Collapsed;
BoardBackgroundColor3Checkbox.Visibility = Visibility.Collapsed;
BoardBackgroundColor4Checkbox.Visibility = Visibility.Collapsed;
BoardBackgroundColor5Checkbox.Visibility = Visibility.Collapsed;
BoardBackgroundColor6Checkbox.Visibility = Visibility.Collapsed;
if (currentMode == 1) {
var index = CurrentWhiteboardIndex - 1;
var bg = BoardPagesSettingsList[index];
if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)0) BoardBackgroundColor1Checkbox.Visibility = Visibility.Visible;
else if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)1) BoardBackgroundColor2Checkbox.Visibility = Visibility.Visible;
else if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)2) BoardBackgroundColor3Checkbox.Visibility = Visibility.Visible;
else if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)3) BoardBackgroundColor4Checkbox.Visibility = Visibility.Visible;
else if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)4) BoardBackgroundColor5Checkbox.Visibility = Visibility.Visible;
else if (bg.BackgroundColor == (BlackboardBackgroundColorEnum)5) BoardBackgroundColor6Checkbox.Visibility = Visibility.Visible;
}
}
#endregion
private void SaveStrokes(bool isBackupMain = false) {
if (isBackupMain) {
var timeMachineHistory = timeMachine.ExportTimeMachineHistory();

View File

@ -8,17 +8,11 @@ using System.Windows.Input;
namespace Ink_Canvas {
public partial class MainWindow : Window {
private void BoardChangeBackgroundColorBtn_MouseUp(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.UsingWhiteboard = !Settings.Canvas.UsingWhiteboard;
SaveSettingsToFile();
if (Settings.Canvas.UsingWhiteboard) {
if (inkColor == 5) lastBoardInkColor = 0;
if (BoardBackgroundPopup.Visibility == Visibility.Visible) {
AnimationsHelper.HideWithSlideAndFade(BoardBackgroundPopup);
} else {
AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardBackgroundPopup);
}
else {
if (inkColor == 0) lastBoardInkColor = 5;
}
CheckColorTheme(true);
}
private void BoardEraserIcon_Click(object sender, RoutedEventArgs e) {

View File

@ -1,6 +1,7 @@
using Ink_Canvas.Helpers;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -69,19 +70,21 @@ namespace Ink_Canvas {
private void CheckColorTheme(bool changeColorTheme = false) {
if (changeColorTheme)
if (currentMode != 0) {
if (Settings.Canvas.UsingWhiteboard) {
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(234, 235, 237));
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
isUselightThemeColor = false;
}
else {
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(22, 41, 36));
var bgC = BoardPagesSettingsList[CurrentWhiteboardIndex - 1].BackgroundColor;
GridBackgroundCover.Background = new SolidColorBrush(BoardBackgroundColors[(int)bgC]);
if (bgC == BlackboardBackgroundColorEnum.BlackBoardGreen
|| bgC == BlackboardBackgroundColorEnum.BlueBlack
|| bgC == BlackboardBackgroundColorEnum.GrayBlack
|| bgC == BlackboardBackgroundColorEnum.RealBlack) {
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
isUselightThemeColor = true;
} else {
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(22, 22,22));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(22, 22, 22));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(22, 22, 22));
isUselightThemeColor = false;
}
}

View File

@ -45,6 +45,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
AnimationsHelper.HideWithSlideAndFade(TwoFingerGestureBorder);
AnimationsHelper.HideWithSlideAndFade(BoardTwoFingerGestureBorder);
AnimationsHelper.HideWithSlideAndFade(BoardBackgroundPopup);
}
else {
AnimationsHelper.HideWithSlideAndFade(EraserSizePanel);
@ -59,6 +60,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
AnimationsHelper.ShowWithSlideFromBottomAndFade(TwoFingerGestureBorder);
AnimationsHelper.ShowWithSlideFromBottomAndFade(BoardTwoFingerGestureBorder);
AnimationsHelper.HideWithSlideAndFade(BoardBackgroundPopup);
}
}
@ -209,6 +211,7 @@ namespace Ink_Canvas {
BorderSettings.Visibility = Visibility.Collapsed;
BoardBorderLeftPageListView.Visibility = Visibility.Collapsed;
BoardBorderRightPageListView.Visibility = Visibility.Collapsed;
BoardBackgroundPopup.Visibility = Visibility.Collapsed;
}
/// <summary>
@ -280,6 +283,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BorderDrawShape);
AnimationsHelper.HideWithSlideAndFade(BoardBorderLeftPageListView);
AnimationsHelper.HideWithSlideAndFade(BoardBorderRightPageListView);
AnimationsHelper.HideWithSlideAndFade(BoardBackgroundPopup);
if (BorderSettings.Visibility == Visibility.Visible) {
SettingsOverlay.IsHitTestVisible = false;
@ -795,6 +799,10 @@ namespace Ink_Canvas {
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
if (lastBorderMouseDownObject != sender) return;
if (inkCanvas.Strokes.Count == 0) {
HideSubPanels();
return;
};
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
@ -1750,14 +1758,13 @@ namespace Ink_Canvas {
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
}
if (Settings.Canvas.UsingWhiteboard)
{
BtnColorBlack_Click(null, null);
}
else
{
var bgC = BoardPagesSettingsList[CurrentWhiteboardIndex - 1].BackgroundColor;
if (bgC == BlackboardBackgroundColorEnum.BlackBoardGreen
|| bgC == BlackboardBackgroundColorEnum.BlueBlack
|| bgC == BlackboardBackgroundColorEnum.GrayBlack
|| bgC == BlackboardBackgroundColorEnum.RealBlack)
BtnColorWhite_Click(null, null);
}
else BtnColorBlack_Click(null, null);
StackPanelPPTButtons.Visibility = Visibility.Collapsed;
Topmost = false;

View File

@ -612,20 +612,7 @@ namespace Ink_Canvas {
ViewBoxStackPanelMain.Margin = new Thickness(10, 10, 10, 55);
if (currentMode != 0) {
//GridBackgroundCover.Visibility = Visibility.Collapsed;
//AnimationsHelper.HideWithSlideAndFade(BlackboardLeftSide);
//AnimationsHelper.HideWithSlideAndFade(BlackboardCenterSide);
//AnimationsHelper.HideWithSlideAndFade(BlackboardRightSide);
//SaveStrokes();
//ClearStrokes(true);
//RestoreStrokes(true);
//BtnSwitch.Content = BtnSwitchTheme.Content.ToString() == "浅色" ? "黑板" : "白板";
//StackPanelPPTButtons.Visibility = Visibility.Visible;
CloseWhiteboardImmediately();
currentMode = 0;
ImageBlackboard_MouseUp(null,null);
}
ClearStrokes(true);

View File

@ -886,6 +886,45 @@ namespace Ink_Canvas {
SaveSettingsToFile();
}
private void ComboBoxBlackboardBackgroundColor_SelectionChanged(object sender, SelectionChangedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.BlackboardBackgroundColor = (BlackboardBackgroundColorEnum)ComboBoxBlackboardBackgroundColor.SelectedIndex;
SaveSettingsToFile();
}
private void ComboBoxBlackboardBackgroundPattern_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!isLoaded) return;
Settings.Canvas.BlackboardBackgroundPattern = (BlackboardBackgroundPatternEnum)ComboBoxBlackboardBackgroundPattern.SelectedIndex;
SaveSettingsToFile();
}
private void ToggleSwitchUseDefaultBackgroundColorForEveryNewAddedBlackboardPage_Toggled(object sender,
RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Canvas.UseDefaultBackgroundColorForEveryNewAddedBlackboardPage =
ToggleSwitchUseDefaultBackgroundColorForEveryNewAddedBlackboardPage.IsOn;
SaveSettingsToFile();
}
private void ToggleSwitchUseDefaultBackgroundPatternForEveryNewAddedBlackboardPage_Toggled(object sender,
RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Canvas.UseDefaultBackgroundPatternForEveryNewAddedBlackboardPage =
ToggleSwitchUseDefaultBackgroundPatternForEveryNewAddedBlackboardPage.IsOn;
SaveSettingsToFile();
}
private void ToggleSwitchIsEnableAutoConvertInkColorWhenBackgroundChanged_Toggled(object sender,
RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Canvas.IsEnableAutoConvertInkColorWhenBackgroundChanged =
ToggleSwitchIsEnableAutoConvertInkColorWhenBackgroundChanged.IsOn;
SaveSettingsToFile();
}
#endregion
#region Automation
@ -1513,6 +1552,11 @@ namespace Ink_Canvas {
Settings.Canvas.FitToCurve = true;
Settings.Canvas.UsingWhiteboard = false;
Settings.Canvas.HyperbolaAsymptoteOption = 0;
Settings.Canvas.BlackboardBackgroundColor = BlackboardBackgroundColorEnum.White;
Settings.Canvas.BlackboardBackgroundPattern = BlackboardBackgroundPatternEnum.None;
Settings.Canvas.IsEnableAutoConvertInkColorWhenBackgroundChanged = false;
Settings.Canvas.UseDefaultBackgroundColorForEveryNewAddedBlackboardPage = false;
Settings.Canvas.UseDefaultBackgroundPatternForEveryNewAddedBlackboardPage = false;
Settings.Gesture.AutoSwitchTwoFingerGesture = true;
Settings.Gesture.IsEnableTwoFingerTranslate = true;

View File

@ -435,19 +435,25 @@ namespace Ink_Canvas {
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
if (Settings.Canvas.UsingWhiteboard) {
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(234, 235, 237));
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(22, 41, 36));
isUselightThemeColor = false;
} else {
GridBackgroundCover.Background = new SolidColorBrush(Color.FromRgb(22, 41, 36));
var bgC = BoardPagesSettingsList[CurrentWhiteboardIndex - 1].BackgroundColor;
GridBackgroundCover.Background = new SolidColorBrush(BoardBackgroundColors[(int)bgC]);
if (bgC == BlackboardBackgroundColorEnum.BlackBoardGreen
|| bgC == BlackboardBackgroundColorEnum.BlueBlack
|| bgC == BlackboardBackgroundColorEnum.GrayBlack
|| bgC == BlackboardBackgroundColorEnum.RealBlack)
{
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(234, 235, 237));
isUselightThemeColor = true;
}
else
{
WaterMarkTime.Foreground = new SolidColorBrush(Color.FromRgb(22, 22, 22));
WaterMarkDate.Foreground = new SolidColorBrush(Color.FromRgb(22, 22, 22));
BlackBoardWaterMark.Foreground = new SolidColorBrush(Color.FromRgb(22, 22, 22));
isUselightThemeColor = false;
}
if (Settings.Canvas.IsShowCursor) {
ToggleSwitchShowCursor.IsOn = true;
@ -523,6 +529,20 @@ namespace Ink_Canvas {
ToggleSwitchFitToCurve.IsOn = false;
drawingAttributes.FitToCurve = false;
}
ComboBoxBlackboardBackgroundColor.SelectedIndex = (int)Settings.Canvas.BlackboardBackgroundColor;
ComboBoxBlackboardBackgroundPattern.SelectedIndex = (int)Settings.Canvas.BlackboardBackgroundPattern;
BoardPagesSettingsList[0].BackgroundColor = Settings.Canvas.BlackboardBackgroundColor;
BoardPagesSettingsList[0].BackgroundPattern = Settings.Canvas.BlackboardBackgroundPattern;
ToggleSwitchUseDefaultBackgroundColorForEveryNewAddedBlackboardPage.IsOn =
Settings.Canvas.UseDefaultBackgroundColorForEveryNewAddedBlackboardPage;
ToggleSwitchUseDefaultBackgroundPatternForEveryNewAddedBlackboardPage.IsOn =
Settings.Canvas.UseDefaultBackgroundPatternForEveryNewAddedBlackboardPage;
ToggleSwitchIsEnableAutoConvertInkColorWhenBackgroundChanged.IsOn =
Settings.Canvas.IsEnableAutoConvertInkColorWhenBackgroundChanged;
} else {
Settings.Canvas = new Canvas();
}

View File

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using System;
using Newtonsoft.Json;
namespace Ink_Canvas
{
@ -49,11 +50,29 @@ namespace Ink_Canvas
[JsonProperty("clearCanvasAndClearTimeMachine")]
public bool ClearCanvasAndClearTimeMachine { get; set; } = false;
[Obsolete("已经使用多背景色“blackboardBackgroundColor”替换该选项")]
[JsonProperty("usingWhiteboard")]
public bool UsingWhiteboard { get; set; }
[JsonProperty("hyperbolaAsymptoteOption")]
public OptionalOperation HyperbolaAsymptoteOption { get; set; } = OptionalOperation.Ask;
[JsonProperty("blackboardBackgroundColor")]
public BlackboardBackgroundColorEnum BlackboardBackgroundColor { get; set; } =
BlackboardBackgroundColorEnum.White;
[JsonProperty("blackboardBackgroundPattern")]
public BlackboardBackgroundPatternEnum BlackboardBackgroundPattern { get; set; } =
BlackboardBackgroundPatternEnum.None;
[JsonProperty("useDefaultBackgroundColorForEveryNewAddedBlackboardPage")]
public bool UseDefaultBackgroundColorForEveryNewAddedBlackboardPage { get; set; } = false;
[JsonProperty("useDefaultBackgroundPatternForEveryNewAddedBlackboardPage")]
public bool UseDefaultBackgroundPatternForEveryNewAddedBlackboardPage { get; set; } = false;
[JsonProperty("isEnableAutoConvertInkColorWhenBackgroundChanged")]
public bool IsEnableAutoConvertInkColorWhenBackgroundChanged { get; set; } = false;
}
public enum OptionalOperation
@ -63,6 +82,23 @@ namespace Ink_Canvas
Ask
}
public enum BlackboardBackgroundColorEnum
{
GrayBlack,
BlackBoardGreen,
White,
BlueBlack,
EyeProtectionGreen,
RealBlack
}
public enum BlackboardBackgroundPatternEnum
{
None,
Dots,
Grid
}
public class Gesture
{
[JsonIgnore]