Browse Source

Add option to disable moving window with cursor

Closes #11
Daniel Chalmers 2 years ago
parent
commit
54168742e8
2 changed files with 2 additions and 1 deletions
  1. 1 1
      DesktopClock/MainWindow.xaml.cs
  2. 1 0
      DesktopClock/Properties/Settings.cs

+ 1 - 1
DesktopClock/MainWindow.xaml.cs

@@ -234,7 +234,7 @@ public partial class MainWindow : Window
 
 
     private void Window_MouseDown(object sender, MouseButtonEventArgs e)
     private void Window_MouseDown(object sender, MouseButtonEventArgs e)
     {
     {
-        if (e.ChangedButton == MouseButton.Left)
+        if (e.ChangedButton == MouseButton.Left && Settings.Default.DragToMove)
         {
         {
             DragMove();
             DragMove();
         }
         }

+ 1 - 0
DesktopClock/Properties/Settings.cs

@@ -62,6 +62,7 @@ public sealed class Settings : INotifyPropertyChanged, IDisposable
     public bool ShowInTaskbar { get; set; } = true;
     public bool ShowInTaskbar { get; set; } = true;
     public int Height { get; set; } = 48;
     public int Height { get; set; } = 48;
     public bool RunOnStartup { get; set; } = false;
     public bool RunOnStartup { get; set; } = false;
+    public bool DragToMove { get; set; } = true;
     public WindowPlacement Placement { get; set; }
     public WindowPlacement Placement { get; set; }
 
 
     [JsonIgnore]
     [JsonIgnore]