fix:issue #159
This commit is contained in:
@@ -307,6 +307,27 @@ namespace Ink_Canvas
|
||||
SidePannelMarginAnimation(-50, !unfoldFloatingBarByUser);
|
||||
});
|
||||
|
||||
// 修复:在浮动栏展开后,重新设置按钮高亮状态
|
||||
await Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// 等待UI完全更新
|
||||
await Task.Delay(100);
|
||||
|
||||
// 获取当前选中的模式并重新设置高光位置
|
||||
string selectedToolMode = GetCurrentSelectedMode();
|
||||
if (!string.IsNullOrEmpty(selectedToolMode))
|
||||
{
|
||||
SetFloatingBarHighlightPosition(selectedToolMode);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogToFile($"浮动栏展开后重新设置按钮高亮状态失败: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
});
|
||||
|
||||
isFloatingBarChangingHideMode = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1713,13 +1713,14 @@ namespace Ink_Canvas
|
||||
// 禁用高级橡皮擦系统
|
||||
DisableAdvancedEraserSystem();
|
||||
|
||||
// 隱藏高亮
|
||||
HideFloatingBarHighlight();
|
||||
|
||||
// 使用集中化的工具模式切换方法,确保快捷键状态正确更新
|
||||
// 鼠标模式下应该禁用快捷键以放行键盘操作
|
||||
SetCurrentToolMode(InkCanvasEditingMode.None);
|
||||
|
||||
// 修复:在浮动栏收起状态下,仍然需要设置按钮高亮状态
|
||||
// 这样在浮动栏展开时能正确显示高光
|
||||
SetFloatingBarHighlightPosition("cursor");
|
||||
|
||||
// 切换前自动截图保存墨迹
|
||||
if (inkCanvas.Strokes.Count > 0 &&
|
||||
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber)
|
||||
@@ -3258,6 +3259,15 @@ namespace Ink_Canvas
|
||||
{
|
||||
if (FloatingbarSelectionBG == null) return;
|
||||
|
||||
// 检查浮动栏是否处于收起状态
|
||||
if (isFloatingBarFolded || (BorderFloatingBarMainControls != null && BorderFloatingBarMainControls.Visibility == Visibility.Collapsed))
|
||||
{
|
||||
// 在收起状态下,仍然需要设置高光位置,但可能需要调整计算方式
|
||||
// 这里先隐藏高光,等浮动栏展开时再显示
|
||||
FloatingbarSelectionBG.Visibility = Visibility.Hidden;
|
||||
return;
|
||||
}
|
||||
|
||||
double position = 0;
|
||||
double buttonWidth = 28; // 每个按钮的默认宽度
|
||||
double highlightWidth = 28; // 高光的默认宽度
|
||||
|
||||
@@ -2715,7 +2715,8 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
// 重新计算浮动栏位置,因为按钮可见性变化会影响浮动栏宽度
|
||||
if (!isFloatingBarFolded && currentMode == 0) // 新增:只在屏幕模式下重新计算浮动栏位置
|
||||
// 修复:移除浮动栏收起状态检查,确保在收起状态下也能正确修正位置
|
||||
if (currentMode == 0) // 只在屏幕模式下重新计算浮动栏位置
|
||||
{
|
||||
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user