新设置窗口:新增可拖动区域 (#401)

* 软件设置内的贡献者列表添加了 PANDA-JSR

* 设置窗口:新增可拖动区域
This commit is contained in:
PANDAJSR
2026-03-14 17:24:54 +08:00
committed by GitHub
parent 133542d7fa
commit bea92f3483
2 changed files with 34 additions and 5 deletions
@@ -1160,6 +1160,30 @@ namespace Ink_Canvas.Windows
_sidebarItemMouseDownBorder = null;
}
private void TopBarBorder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton != MouseButton.Left) return;
DragMove();
}
private void SidebarTopBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton != MouseButton.Left) return;
var source = e.OriginalSource as DependencyObject;
if (IsInsideElement(source, SearchButtonBorder) || IsInsideElement(source, MenuButtonBorder))
return;
DragMove();
}
private static bool IsInsideElement(DependencyObject source, DependencyObject target)
{
if (source == null || target == null) return false;
if (source == target) return true;
return IsInsideElement(VisualTreeHelper.GetParent(source), target);
}
private void CloseButton_Click(object sender, MouseButtonEventArgs e)
{
Close();
@@ -1838,4 +1862,4 @@ namespace Ink_Canvas.Windows
#endregion
}
}
}