diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml index ba1eba77..6d822b1f 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml @@ -650,7 +650,9 @@ - + @@ -664,7 +666,8 @@ - + @@ -858,7 +861,8 @@ - + @@ -868,7 +872,8 @@ - + diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs index b4e18967..5cf1fbdc 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs @@ -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 } -} \ No newline at end of file +}