improve:PPT放映时的浮动栏定位

This commit is contained in:
CJK_mkp
2025-12-27 16:41:30 +08:00
parent 73d1dc8f48
commit 3f8cabc7e0
2 changed files with 9 additions and 43 deletions
@@ -3082,10 +3082,7 @@ namespace Ink_Canvas
await Task.Delay(700); await Task.Delay(700);
await Dispatcher.InvokeAsync(() => await Dispatcher.InvokeAsync(() =>
{ {
if (_pptManager?.IsInSlideShow != true) FoldFloatingBar_MouseUp(new object(), null);
{
FoldFloatingBar_MouseUp(new object(), null);
}
}); });
}); });
} }
+8 -39
View File
@@ -730,7 +730,7 @@ namespace Ink_Canvas
if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow && if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow &&
!Settings.Automation.IsAutoFoldInPPTSlideShow) !Settings.Automation.IsAutoFoldInPPTSlideShow)
{ {
await Task.Delay(300); await Task.Delay(600);
// 先进入批注模式,这会显示调色盘 // 先进入批注模式,这会显示调色盘
PenIcon_Click(null, null); PenIcon_Click(null, null);
// 然后设置颜色 // 然后设置颜色
@@ -771,48 +771,17 @@ namespace Ink_Canvas
LoadCurrentSlideInk(currentSlide); LoadCurrentSlideInk(currentSlide);
}); });
if (!isFloatingBarFolded) if (!isFloatingBarFolded)
{ {
_ = Task.Run(async () => new Thread(() =>
{ {
try Thread.Sleep(100);
Application.Current.Dispatcher.Invoke(() =>
{ {
await Task.Delay(100); ViewboxFloatingBarMarginAnimation(60);
});
await Application.Current.Dispatcher.InvokeAsync(() => }).Start();
{
ViewboxFloatingBar.UpdateLayout();
// 如果浮动栏宽度仍未计算好,再等待一段时间
if (ViewboxFloatingBar.ActualWidth <= 0)
{
LogHelper.WriteLogToFile("浮动栏宽度未准备好,等待布局完成", LogHelper.LogType.Trace);
}
});
await Task.Delay(100);
await Application.Current.Dispatcher.InvokeAsync(() =>
{
PureViewboxFloatingBarMarginAnimationInPPTMode(false);
});
}
catch (Exception)
{
try
{
await Task.Delay(100);
await Application.Current.Dispatcher.InvokeAsync(() =>
{
ViewboxFloatingBarMarginAnimation(60);
});
}
catch (Exception)
{
}
}
});
} }
} }
catch (Exception) catch (Exception)