瀏覽代碼

Add option to disable moving window with cursor

Closes #11
Daniel Chalmers 2 年之前
父節點
當前提交
54168742e8
共有 2 個文件被更改,包括 2 次插入1 次删除
  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)
     {
-        if (e.ChangedButton == MouseButton.Left)
+        if (e.ChangedButton == MouseButton.Left && Settings.Default.DragToMove)
         {
             DragMove();
         }

+ 1 - 0
DesktopClock/Properties/Settings.cs

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