Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
WXRIW authored Mar 14, 2024
2 parents f84a4f2 + 80c57dc commit b8b9e7a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Ink Canvas/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@
<Bold>开发者:</Bold> XY Wang (WXRIW)
</TextBlock>
<TextBlock FontSize="14" TextWrapping="Wrap">
<Bold>贡献者:</Bold> Kengwang, Raspberry Kan, jiajiaxd, CN-Ironegg, Clover Yan, ZongziTEK, ChangSakura
<Bold>贡献者:</Bold> Kengwang, Raspberry Kan, jiajiaxd, CN-Ironegg, Clover Yan, STBBRD, ChangSakura
</TextBlock>
<TextBlock FontSize="14">
<Bold>开源地址:</Bold>
Expand Down
64 changes: 50 additions & 14 deletions Ink Canvas/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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 @@ -249,7 +249,7 @@ private void Main_Grid_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (StackPanelPPTControls.Visibility != Visibility.Visible || currentMode != 0) return;

if (e.Key == Key.Down || e.Key == Key.PageDown || e.Key == Key.Right || e.Key == Key.N)
if (e.Key == Key.Down || e.Key == Key.PageDown || e.Key == Key.Right || e.Key == Key.N || e.Key == Key.Space)
{
BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null);
}
Expand Down Expand Up @@ -700,6 +700,14 @@ private void LoadSettings(bool isStartup = true)
{
ToggleSwitchEnableTwoFingerZoom.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerTranslate)
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = true;
}
else
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerRotation)
{
ToggleSwitchEnableTwoFingerRotation.IsOn = true;
Expand Down Expand Up @@ -759,6 +767,8 @@ private void LoadSettings(bool isStartup = true)
ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;

ComboBoxEraserSize.SelectedIndex = Settings.Canvas.EraserSize;

ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
}
else
{
Expand Down Expand Up @@ -1043,9 +1053,9 @@ private void BtnErase_Click(object sender, RoutedEventArgs e)
forcePointEraser = false;
break;
}
inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
inkCanvas.EditingMode =
forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke;
inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
drawingShapeMode = 0;
GeometryDrawingEraser.Brush = forcePointEraser
? new SolidColorBrush(Color.FromRgb(0x23, 0xA9, 0xF2))
Expand All @@ -1060,6 +1070,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 @@ -1147,6 +1166,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e)
}
StackPanelPPTButtons.Visibility = Visibility.Visible;
}
Topmost = true;
BtnHideInkCanvas_Click(BtnHideInkCanvas, e);
}
else
Expand Down Expand Up @@ -1186,6 +1206,7 @@ private void BtnSwitch_Click(object sender, RoutedEventArgs e)
}

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

StackPanelPPTButtons.Visibility = Visibility.Collapsed;
Topmost = false;
break;
}
}
Expand Down Expand Up @@ -2288,8 +2310,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 @@ -4122,7 +4147,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 @@ -4141,7 +4169,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 @@ -4160,7 +4191,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 @@ -4179,7 +4213,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 @@ -4198,7 +4235,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 @@ -7070,8 +7110,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 @@ -7105,8 +7143,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 b8b9e7a

Please sign in to comment.