Browse Source

Context menu doesn't want to be opened normally

Ruben 10 months ago
parent
commit
91f0c2a7c7
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/PicView.Avalonia/Views/BottomBar.axaml.cs

+ 7 - 0
src/PicView.Avalonia/Views/BottomBar.axaml.cs

@@ -87,6 +87,13 @@ public partial class BottomBar : UserControl
     private void MoveWindow(PointerPressedEventArgs e)
     {
         if (VisualRoot is null) { return; }
+        
+        if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed)
+        {
+            // Context menu doesn't want to be opened normally
+            MainContextMenu.Open();
+            return;
+        }
 
         WindowFunctions.WindowDragBehavior((Window)VisualRoot, e);
     }