Skip to content

Commit

Permalink
Merge pull request #114 from clover-yan/patch/chore
Browse files Browse the repository at this point in the history
多个杂项问题修复
  • Loading branch information
Raspberry-Monster authored Mar 3, 2024
2 parents b404006 + 8136db7 commit 80c57dc
Showing 1 changed file with 38 additions and 12 deletions.
50 changes: 38 additions & 12 deletions Ink Canvas/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void TimerKillProcess_Elapsed(object sender, ElapsedEventArgs e)
if (processes.Length > 0)
{
arg += " /IM SeewoIwbAssistant.exe" +
" /IM Sia.Guard";
" /IM Sia.Guard.exe";
}
}
if (Settings.Automation.IsAutoKillEasiNote)
Expand Down Expand Up @@ -1072,6 +1072,15 @@ private void BtnClear_Click(object sender, RoutedEventArgs e)
forceEraser = false;
BorderClearInDelete.Visibility = Visibility.Collapsed;

if (currentMode == 0) {
BorderPenColorRed_MouseUp(BorderPenColorRed, null);
} else {
if (Settings.Canvas.UsingWhiteboard) {
BorderPenColorBlack_MouseUp(BorderPenColorBlack, null);
} else {
BorderPenColorWhite_MouseUp(BorderPenColorWhite, null);
}
}
if (inkCanvas.Strokes.Count != 0)
{
int whiteboardIndex = CurrentWhiteboardIndex;
Expand Down Expand Up @@ -1159,6 +1168,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e)
}
StackPanelPPTButtons.Visibility = Visibility.Visible;
}
Topmost = true;
BtnHideInkCanvas_Click(BtnHideInkCanvas, e);
}
else
Expand Down Expand Up @@ -1198,6 +1208,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e)
}

StackPanelPPTButtons.Visibility = Visibility.Visible;
Topmost = true;
break;
case 1: //黑板或白板模式
currentMode = 1;
Expand All @@ -1222,6 +1233,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e)
}

StackPanelPPTButtons.Visibility = Visibility.Collapsed;
Topmost = false;
break;
}
}
Expand Down Expand Up @@ -2250,8 +2262,11 @@ private void PptApplication_SlideShowBegin(SlideShowWindow Wn)
LogHelper.WriteLogToFile("PowerPoint Application Slide Show Begin", LogHelper.LogType.Event);
Application.Current.Dispatcher.Invoke(() =>
{
// 退出画板模式
BtnSwitch_Click(null, null);
if (currentMode == 1) {
// 退出画板模式
BtnSwitch_Click(null, null);
}

//调整颜色
double screenRatio = SystemParameters.PrimaryScreenWidth / SystemParameters.PrimaryScreenHeight;
if (Math.Abs(screenRatio - 16.0 / 9) <= -0.01)
Expand Down Expand Up @@ -4084,7 +4099,10 @@ private void BtnDrawLine_Click(object sender, EventArgs e)
lastMouseDownSender = null;
if (isLongPressSelected)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
}
var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0)));
ImageDrawLine.BeginAnimation(OpacityProperty, dA);
}
Expand All @@ -4103,7 +4121,10 @@ private void BtnDrawDashedLine_Click(object sender, EventArgs e)
lastMouseDownSender = null;
if (isLongPressSelected)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
}
var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0)));
ImageDrawDashedLine.BeginAnimation(OpacityProperty, dA);
}
Expand All @@ -4122,7 +4143,10 @@ private void BtnDrawDotLine_Click(object sender, EventArgs e)
lastMouseDownSender = null;
if (isLongPressSelected)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
}
var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0)));
ImageDrawDotLine.BeginAnimation(OpacityProperty, dA);
}
Expand All @@ -4141,7 +4165,10 @@ private void BtnDrawArrow_Click(object sender, EventArgs e)
lastMouseDownSender = null;
if (isLongPressSelected)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
}
var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0)));
ImageDrawArrow.BeginAnimation(OpacityProperty, dA);
}
Expand All @@ -4160,7 +4187,10 @@ private void BtnDrawParallelLine_Click(object sender, EventArgs e)
lastMouseDownSender = null;
if (isLongPressSelected)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
if (ToggleSwitchDrawShapeBorderAutoHide.IsOn)
{
BorderDrawShape.Visibility = Visibility.Collapsed;
}
var dA = new DoubleAnimation(1, 1, new Duration(TimeSpan.FromMilliseconds(0)));
ImageDrawParallelLine.BeginAnimation(OpacityProperty, dA);
}
Expand Down Expand Up @@ -6978,8 +7008,6 @@ private void ImageBlackboard_MouseUp(object sender, MouseButtonEventArgs e)
if (currentMode == 0)
{
//进入黑板
Topmost = false;

if (BtnPPTSlideShowEnd.Visibility == Visibility.Collapsed)
{
pointDesktop = new Point(ViewboxFloatingBar.Margin.Left, ViewboxFloatingBar.Margin.Top);
Expand Down Expand Up @@ -7010,8 +7038,6 @@ private void ImageBlackboard_MouseUp(object sender, MouseButtonEventArgs e)
else
{
//关闭黑板
Topmost = true;

if (isInMultiTouchMode) BorderMultiTouchMode_MouseUp(null, null);

if (BtnPPTSlideShowEnd.Visibility == Visibility.Collapsed)
Expand Down

0 comments on commit 80c57dc

Please sign in to comment.