[feature] 浮动工具栏缩放调节,取消收纳按钮图标修改

This commit is contained in:
Dubi906w 2024-05-13 01:54:04 +08:00
parent 189b6ba876
commit b8813d11ee
11 changed files with 165 additions and 78 deletions

View File

@ -65,7 +65,7 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Title>InkCanvasForClass</Title>
<Version>5.0.3</Version>
<Version>5.0.4</Version>
<Authors>Dubi906w</Authors>
<Product>InkCanvasForClass</Product>
<Copyright>© Copyright HARKOTEK Studio 2024-now</Copyright>
@ -182,6 +182,7 @@
<Resource Include="Resources\Icons-png\check-box-background.png" />
<Resource Include="Resources\Icons-png\eraser-line.png" />
<Resource Include="Resources\Icons-png\eraser-outline.png" />
<Resource Include="Resources\Icons-png\icc.png" />
<Resource Include="Resources\Icons-png\playCircle.png" />
<Resource Include="Resources\Icons-png\redo.png" />
<Resource Include="Resources\Icons-png\setting.png" />
@ -450,6 +451,7 @@
<Compile Remove="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Icons-png\icc.png" />
<None Remove="Resources\Icons-png\transparent-grid.png" />
<None Remove="Resources\new-icons\chevron-left.png" />
<None Remove="Resources\new-icons\end-slides-show.png" />

View File

@ -972,13 +972,14 @@
<TextBlock Text="在调色盘窗口中显示 笔尖模式 按钮" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableDisPlayNibModeToggle" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableDisPlayNibModeToggle_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<!--<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="浮动工具栏背景色" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchColorfulViewboxFloatingBar" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchIsColorfulViewboxFloatingBar_Toggled" />
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>-->
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="浮动工具栏 UI 85% 缩放" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableViewboxFloatingBarScaleTransform" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableViewboxFloatingBarScaleTransform_Toggled" />
<TextBlock Text="浮动工具栏缩放" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Minimum="0.5" Maximum="1.25" Width="168" FontFamily="Microsoft YaHei UI" FontSize="20" IsSnapToTickEnabled="True" Value="1" TickFrequency="0.05" TickPlacement="None" ValueChanged="ViewboxFloatingBarScaleTransformValueSlider_ValueChanged"/>
<TextBlock Text="{Binding ElementName=ViewboxFloatingBarScaleTransformValueSlider, Path=Value}" VerticalAlignment="Center" FontSize="14" FontFamily="Consolas" Margin="12,0,16,0"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="白板 UI 80% 缩放" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
@ -992,6 +993,13 @@
<TextBlock Text="在收纳模式下启用快速面板" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableQuickPanel" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableQuickPanel_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="取消收纳按钮图标" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ComboBox Name="ComboBoxUnFoldBtnImg" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxUnFoldBtnImg_SelectionChanged">
<ComboBoxItem Content="箭头" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="笔" FontFamily="Microsoft YaHei UI"/>
</ComboBox>
</ui:SimpleStackPanel>
<!--
<TextBlock Text="颜色主题" FontFamily="Microsoft YaHei UI" FontSize="14"/>
<ComboBox Name="ComboBoxTheme" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxTheme_SelectionChanged">
@ -1618,16 +1626,16 @@
</Viewbox>
<Viewbox Name="ViewboxFloatingBar" Margin="100,5,0,0"
HorizontalAlignment="Left" Height="58" VerticalAlignment="Top" Width="733">
HorizontalAlignment="Left" Height="58" VerticalAlignment="Top" Width="733" RenderTransformOrigin="0.5,0.5">
<Viewbox.LayoutTransform>
<ScaleTransform x:Name="ViewboxFloatingBarScaleTransform" ScaleX="1" ScaleY="1"/>
</Viewbox.LayoutTransform>
<ui:SimpleStackPanel Orientation="Horizontal">
<Border x:Name="BorderFloatingBarMoveControls" Width="36" Height="36" CornerRadius="5" Background="#fafafa" BorderThickness="1" BorderBrush="#9952525b"
MouseDown="SymbolIconEmoji_MouseDown" MouseUp="SymbolIconEmoji_MouseUp">
<ui:SimpleStackPanel Margin="0,5,0,5" Orientation="Horizontal"
<ui:SimpleStackPanel Margin="0,2,0,2" Orientation="Horizontal"
HorizontalAlignment="Center">
<ui:SymbolIcon Name="SymbolIconEmoji" Symbol="Emoji2" Foreground="{DynamicResource FloatBarForeground}"/>
<Image Source="/Resources/Icons-png/icc.png"/>
</ui:SimpleStackPanel>
</Border>
<Border Margin="2,0,0,0" Padding="2" Visibility="Visible" Height="36" Name="BorderFloatingBarMainControls" Background="#fafafa" CornerRadius="5" BorderThickness="1" BorderBrush="#9952525b">
@ -2352,7 +2360,7 @@
<Viewbox x:Name="LeftSidePanel" MouseUp="LeftUnFoldButtonDisplayQuickPanel_MouseUp" Visibility="Visible" Height="50" Width="32" Margin="-60,0,0,-150" HorizontalAlignment="Left" VerticalAlignment="Center">
<ui:SimpleStackPanel>
<Border Background="#9918181b" Opacity="1" CornerRadius="0,25,25,0" Height="50" Width="32">
<Image Margin="10,0,0,0" Source="/Resources/new-icons/unfold-chevron.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
<Image x:Name="LeftUnFoldBtnImgChevron" Margin="10,0,0,0" Source="/Resources/new-icons/unfold-chevron.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
</Border>
</ui:SimpleStackPanel>
</Viewbox>
@ -2388,13 +2396,10 @@
<Viewbox x:Name="RightSidePanel" MouseUp="RightUnFoldButtonDisplayQuickPanel_MouseUp" Visibility="{Binding ElementName=LeftSidePanel, Path=Visibility}" Height="50" Width="32" Margin="0,0,-60,-150" HorizontalAlignment="Right" VerticalAlignment="Center">
<ui:SimpleStackPanel>
<Border Background="#9918181b" Opacity="1" CornerRadius="25,0,0,25" Height="50" Width="32">
<Image Margin="0,0,10,0" Source="/Resources/new-icons/unfold-chevron.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14" RenderTransformOrigin="0.5,0.5">
<Image Margin="0,0,10,0" x:Name="RightUnFoldBtnImgChevron" Source="/Resources/new-icons/unfold-chevron.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>

View File

@ -44,7 +44,7 @@ namespace Ink_Canvas {
ViewBoxStackPanelMain.Visibility = Visibility.Collapsed;
ViewBoxStackPanelShapes.Visibility = Visibility.Collapsed;
ViewboxFloatingBar.Margin = new Thickness((SystemParameters.WorkArea.Width - 284) / 2, SystemParameters.WorkArea.Height - 60, -2000, -200);
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100,true);
try {
if (File.Exists("debug.ini")) Label.Visibility = Visibility.Visible;

View File

@ -3,7 +3,9 @@ using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
namespace Ink_Canvas {
public partial class MainWindow : Window {
@ -108,9 +110,9 @@ namespace Ink_Canvas {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
ViewboxFloatingBarMarginAnimation(60);
} else {
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100, true);
}
SidePannelMarginAnimation(-50,true);
SidePannelMarginAnimation(-50, !unfoldFloatingBarByUser);
});
isFloatingBarChangingHideMode = false;
@ -122,12 +124,12 @@ namespace Ink_Canvas {
if (MarginFromEdge == -10) LeftSidePanel.Visibility = Visibility.Visible;
ThicknessAnimation LeftSidePanelmarginAnimation = new ThicknessAnimation {
Duration = TimeSpan.FromSeconds(isNoAnimation? 0 : 0.175),
Duration = isNoAnimation==true? TimeSpan.FromSeconds(0) : TimeSpan.FromSeconds(0.175),
From = LeftSidePanel.Margin,
To = new Thickness(MarginFromEdge, 0, 0, -150)
};
ThicknessAnimation RightSidePanelmarginAnimation = new ThicknessAnimation {
Duration = TimeSpan.FromSeconds(isNoAnimation ? 0 : 0.175),
Duration = isNoAnimation == true ? TimeSpan.FromSeconds(0) : TimeSpan.FromSeconds(0.175),
From = RightSidePanel.Margin,
To = new Thickness(0, 0, MarginFromEdge, -150)
};

View File

@ -44,10 +44,12 @@ namespace Ink_Canvas {
private void CheckEnableTwoFingerGestureBtnColorPrompt() {
if (ToggleSwitchEnableMultiTouchMode.IsOn) {
TwoFingerGestureSimpleStackPanel.Opacity = 0.5;
TwoFingerGestureSimpleStackPanel.IsHitTestVisible = false;
EnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/new-icons/gesture.png", UriKind.Relative));
} else {
TwoFingerGestureSimpleStackPanel.Opacity = 1;
TwoFingerGestureSimpleStackPanel.IsHitTestVisible = true;
if (Settings.Gesture.IsEnableTwoFingerGesture) {
EnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/new-icons/gesture-enabled.png", UriKind.Relative));
BoardEnableTwoFingerGestureBtn.Source = new BitmapImage(new Uri("/Resources/new-icons/gesture-enabled.png", UriKind.Relative));
@ -102,8 +104,6 @@ namespace Ink_Canvas {
pos = e.GetPosition(null);
downPos = e.GetPosition(null);
GridForFloatingBarDraging.Visibility = Visibility.Visible;
SymbolIconEmoji.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Emoji;
}
void SymbolIconEmoji_MouseUp(object sender, MouseButtonEventArgs e) {
@ -120,7 +120,6 @@ namespace Ink_Canvas {
}
GridForFloatingBarDraging.Visibility = Visibility.Collapsed;
SymbolIconEmoji.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Emoji2;
}
#endregion
@ -267,7 +266,7 @@ namespace Ink_Canvas {
} else if (Topmost == true) //非黑板
{
await Task.Delay(50);
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100, true);
} else //黑板
{
await Task.Delay(50);
@ -449,7 +448,7 @@ namespace Ink_Canvas {
new Thread(new ThreadStart(() => {
Thread.Sleep(100);
Application.Current.Dispatcher.Invoke(() => {
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100, true);
});
})).Start();
} else {
@ -657,7 +656,7 @@ namespace Ink_Canvas {
bool isViewboxFloatingBarMarginAnimationRunning = false;
private async void ViewboxFloatingBarMarginAnimation(int MarginFromEdge) {
private async void ViewboxFloatingBarMarginAnimation(int MarginFromEdge, bool PosXCaculatedWithTaskbarHeight = false) {
if (MarginFromEdge == 60) {
MarginFromEdge = 55;
}
@ -678,8 +677,16 @@ namespace Ink_Canvas {
IntPtr windowHandle = new WindowInteropHelper(this).Handle;
System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
double toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - SystemParameters.WindowCaptionHeight;
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
pos.Y = screenHeight - MarginFromEdge * ((ViewboxFloatingBarScaleTransform.ScaleY == 1) ? 1 : 0.9);
if (PosXCaculatedWithTaskbarHeight == false) {
pos.Y = screenHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY;
}
else if(PosXCaculatedWithTaskbarHeight == true)
{
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3;
}
if (MarginFromEdge != -60) {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
@ -702,7 +709,7 @@ namespace Ink_Canvas {
}
ThicknessAnimation marginAnimation = new ThicknessAnimation {
Duration = TimeSpan.FromSeconds(0.5),
Duration = TimeSpan.FromSeconds(0.3),
From = ViewboxFloatingBar.Margin,
To = new Thickness(pos.X, pos.Y, -2000, -200)
};
@ -808,7 +815,7 @@ namespace Ink_Canvas {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
ViewboxFloatingBarMarginAnimation(60);
} else {
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100,true);
}
}
}

View File

@ -451,7 +451,7 @@ namespace Ink_Canvas {
});
await Task.Delay(150);
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100,true);
}
int previousSlideID = 0;
@ -590,7 +590,7 @@ namespace Ink_Canvas {
HideSubPanels("cursor");
await Task.Delay(150);
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100, true);
}
private void GridPPTControlPrevious_MouseUp(object sender, MouseButtonEventArgs e) {

View File

@ -6,10 +6,10 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Diagnostics;
using File = System.IO.File;
using System.Windows.Media;
using System.Windows.Ink;
using System.Windows.Media.Imaging;
namespace Ink_Canvas {
public partial class MainWindow : Window {
@ -105,29 +105,76 @@ namespace Ink_Canvas {
if (!isLoaded) return;
Settings.Appearance.IsEnableDisPlayNibModeToggler = ToggleSwitchEnableDisPlayNibModeToggle.IsOn;
SaveSettingsToFile();
LoadSettings();
if (!ToggleSwitchEnableDisPlayNibModeToggle.IsOn)
{
NibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
BoardNibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
}
else
{
NibModeSimpleStackPanel.Visibility = Visibility.Visible;
BoardNibModeSimpleStackPanel.Visibility = Visibility.Visible;
}
}
private void ToggleSwitchIsColorfulViewboxFloatingBar_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Appearance.IsColorfulViewboxFloatingBar = ToggleSwitchColorfulViewboxFloatingBar.IsOn;
SaveSettingsToFile();
LoadSettings();
}
//private void ToggleSwitchIsColorfulViewboxFloatingBar_Toggled(object sender, RoutedEventArgs e) {
// if (!isLoaded) return;
// Settings.Appearance.IsColorfulViewboxFloatingBar = ToggleSwitchColorfulViewboxFloatingBar.IsOn;
// SaveSettingsToFile();
//}
private void ToggleSwitchEnableQuickPanel_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Appearance.IsShowQuickPanel = ToggleSwitchEnableQuickPanel.IsOn;
SaveSettingsToFile();
LoadSettings();
}
private void ToggleSwitchEnableViewboxFloatingBarScaleTransform_Toggled(object sender, RoutedEventArgs e) {
private void ViewboxFloatingBarScaleTransformValueSlider_ValueChanged(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Appearance.EnableViewboxFloatingBarScaleTransform = ToggleSwitchEnableViewboxFloatingBarScaleTransform.IsOn;
Settings.Appearance.ViewboxFloatingBarScaleTransformValue = ViewboxFloatingBarScaleTransformValueSlider.Value;
SaveSettingsToFile();
LoadSettings();
double val = ViewboxFloatingBarScaleTransformValueSlider.Value;
ViewboxFloatingBarScaleTransform.ScaleX = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleY = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
// auto align
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
{
ViewboxFloatingBarMarginAnimation(60);
}
else
{
ViewboxFloatingBarMarginAnimation(100,true);
}
}
private void ComboBoxUnFoldBtnImg_SelectionChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Appearance.UnFoldButtonImageType = ComboBoxUnFoldBtnImg.SelectedIndex;
SaveSettingsToFile();
if (ComboBoxUnFoldBtnImg.SelectedIndex == 0)
{
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
RightUnFoldBtnImgChevron.Width = 14;
RightUnFoldBtnImgChevron.Height = 14;
RightUnFoldBtnImgChevron.RenderTransform = new RotateTransform(180);
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
LeftUnFoldBtnImgChevron.Width = 14;
LeftUnFoldBtnImgChevron.Height = 14;
LeftUnFoldBtnImgChevron.RenderTransform = null;
}
else if (ComboBoxUnFoldBtnImg.SelectedIndex == 1)
{
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
RightUnFoldBtnImgChevron.Width = 18;
RightUnFoldBtnImgChevron.Height = 18;
RightUnFoldBtnImgChevron.RenderTransform = null;
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
LeftUnFoldBtnImgChevron.Width = 18;
LeftUnFoldBtnImgChevron.Height = 18;
LeftUnFoldBtnImgChevron.RenderTransform = null;
}
}
private void ToggleSwitchEnableViewboxBlackBoardScaleTransform_Toggled(object sender, RoutedEventArgs e) {
@ -695,7 +742,7 @@ namespace Ink_Canvas {
Settings.Appearance.IsEnableDisPlayNibModeToggler = false;
Settings.Appearance.IsColorfulViewboxFloatingBar = false;
Settings.Appearance.EnableViewboxFloatingBarScaleTransform = true;
Settings.Appearance.ViewboxFloatingBarScaleTransformValue = 1;
Settings.Appearance.EnableViewboxBlackBoardScaleTransform = false;
Settings.Appearance.IsTransparentButtonBackground = true;
Settings.Appearance.IsShowExitButton = true;

View File

@ -6,6 +6,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Ink;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using File = System.IO.File;
namespace Ink_Canvas {
@ -80,41 +81,60 @@ namespace Ink_Canvas {
NibModeSimpleStackPanel.Visibility = Visibility.Visible;
BoardNibModeSimpleStackPanel.Visibility = Visibility.Visible;
}
if (Settings.Appearance.IsColorfulViewboxFloatingBar) // 浮动工具栏背景色
//if (Settings.Appearance.IsColorfulViewboxFloatingBar) // 浮动工具栏背景色
//{
// LinearGradientBrush gradientBrush = new LinearGradientBrush();
// gradientBrush.StartPoint = new Point(0, 0);
// gradientBrush.EndPoint = new Point(1, 1);
// GradientStop blueStop = new GradientStop(Color.FromArgb(0x95, 0x80, 0xB0, 0xFF), 0);
// GradientStop greenStop = new GradientStop(Color.FromArgb(0x95, 0xC0, 0xFF, 0xC0), 1);
// gradientBrush.GradientStops.Add(blueStop);
// gradientBrush.GradientStops.Add(greenStop);
// EnableTwoFingerGestureBorder.Background = gradientBrush;
// BorderFloatingBarMainControls.Background = gradientBrush;
// BorderFloatingBarMoveControls.Background = gradientBrush;
// BorderFloatingBarExitPPTBtn.Background = gradientBrush;
// ToggleSwitchColorfulViewboxFloatingBar.IsOn = true;
//} else {
// EnableTwoFingerGestureBorder.Background = (Brush)FindResource("FloatBarBackground");
// BorderFloatingBarMainControls.Background = (Brush)FindResource("FloatBarBackground");
// BorderFloatingBarMoveControls.Background = (Brush)FindResource("FloatBarBackground");
// BorderFloatingBarExitPPTBtn.Background = (Brush)FindResource("FloatBarBackground");
// ToggleSwitchColorfulViewboxFloatingBar.IsOn = false;
//}
if (Settings.Appearance.ViewboxFloatingBarScaleTransformValue != 0) // 浮动工具栏 UI 缩放 85%
{
LinearGradientBrush gradientBrush = new LinearGradientBrush();
gradientBrush.StartPoint = new Point(0, 0);
gradientBrush.EndPoint = new Point(1, 1);
GradientStop blueStop = new GradientStop(Color.FromArgb(0x95, 0x80, 0xB0, 0xFF), 0);
GradientStop greenStop = new GradientStop(Color.FromArgb(0x95, 0xC0, 0xFF, 0xC0), 1);
gradientBrush.GradientStops.Add(blueStop);
gradientBrush.GradientStops.Add(greenStop);
EnableTwoFingerGestureBorder.Background = gradientBrush;
BorderFloatingBarMainControls.Background = gradientBrush;
BorderFloatingBarMoveControls.Background = gradientBrush;
BorderFloatingBarExitPPTBtn.Background = gradientBrush;
ToggleSwitchColorfulViewboxFloatingBar.IsOn = true;
} else {
EnableTwoFingerGestureBorder.Background = (Brush)FindResource("FloatBarBackground");
BorderFloatingBarMainControls.Background = (Brush)FindResource("FloatBarBackground");
BorderFloatingBarMoveControls.Background = (Brush)FindResource("FloatBarBackground");
BorderFloatingBarExitPPTBtn.Background = (Brush)FindResource("FloatBarBackground");
ToggleSwitchColorfulViewboxFloatingBar.IsOn = false;
double val = Settings.Appearance.ViewboxFloatingBarScaleTransformValue;
ViewboxFloatingBarScaleTransform.ScaleX = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleY = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransformValueSlider.Value = val;
}
if (Settings.Appearance.EnableViewboxFloatingBarScaleTransform) // 浮动工具栏 UI 缩放 85%
ComboBoxUnFoldBtnImg.SelectedIndex = Settings.Appearance.UnFoldButtonImageType;
if (Settings.Appearance.UnFoldButtonImageType==0)
{
ViewboxFloatingBarScaleTransform.ScaleX = 0.85;
ViewboxFloatingBarScaleTransform.ScaleY = 0.85;
ToggleSwitchEnableViewboxFloatingBarScaleTransform.IsOn = true;
} else {
ViewboxFloatingBarScaleTransform.ScaleX = 1;
ViewboxFloatingBarScaleTransform.ScaleY = 1;
ToggleSwitchEnableViewboxFloatingBarScaleTransform.IsOn = false;
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
RightUnFoldBtnImgChevron.Width = 14;
RightUnFoldBtnImgChevron.Height = 14;
RightUnFoldBtnImgChevron.RenderTransform = new RotateTransform(180);
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
LeftUnFoldBtnImgChevron.Width = 14;
LeftUnFoldBtnImgChevron.Height = 14;
LeftUnFoldBtnImgChevron.RenderTransform = null;
} else if (Settings.Appearance.UnFoldButtonImageType ==1)
{
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
RightUnFoldBtnImgChevron.Width = 18;
RightUnFoldBtnImgChevron.Height = 18;
RightUnFoldBtnImgChevron.RenderTransform = null;
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
LeftUnFoldBtnImgChevron.Width = 18;
LeftUnFoldBtnImgChevron.Height = 18;
LeftUnFoldBtnImgChevron.RenderTransform = null;
}
if (Settings.Appearance.IsShowQuickPanel)
{
ToggleSwitchEnableQuickPanel.IsOn = true;
@ -583,7 +603,7 @@ namespace Ink_Canvas {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
ViewboxFloatingBarMarginAnimation(60);
} else {
ViewboxFloatingBarMarginAnimation(100);
ViewboxFloatingBarMarginAnimation(100, true);
}
}
}

View File

@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.0.3.0")]
[assembly: AssemblyFileVersion("5.0.3.0")]
[assembly: AssemblyVersion("5.0.4.0")]
[assembly: AssemblyFileVersion("5.0.4.0")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -111,8 +111,10 @@ namespace Ink_Canvas
public bool IsEnableDisPlayNibModeToggler { get; set; } = true;
[JsonProperty("isColorfulViewboxFloatingBar")]
public bool IsColorfulViewboxFloatingBar { get; set; } = false;
[JsonProperty("enableViewboxFloatingBarScaleTransform")]
public bool EnableViewboxFloatingBarScaleTransform { get; set; } = false;
// [JsonProperty("enableViewboxFloatingBarScaleTransform")]
// public bool EnableViewboxFloatingBarScaleTransform { get; set; } = false;
[JsonProperty("viewboxFloatingBarScaleTransformValue")]
public double ViewboxFloatingBarScaleTransformValue { get; set; } = 1.0;
[JsonProperty("enableViewboxBlackBoardScaleTransform")]
public bool EnableViewboxBlackBoardScaleTransform { get; set; } = false;
[JsonProperty("isTransparentButtonBackground")]
@ -125,6 +127,8 @@ namespace Ink_Canvas
public bool EnableTimeDisplayInWhiteboardMode { get; set; } = true;
[JsonProperty("isShowHideControlButton")]
public bool IsShowHideControlButton { get; set; } = false;
[JsonProperty("unFoldButtonImageType")]
public int UnFoldButtonImageType { get; set; } = 0;
[JsonProperty("isShowLRSwitchButton")]
public bool IsShowLRSwitchButton { get; set; } = false;
[JsonProperty("isShowQuickPanel")]