[meld/deprecation-cleanup: 11/48] gutterrendererchunk: Update to new popup API and fix positioning



commit de91dad7fcb84d3b886f6e4eddf42fbd811913e9
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Nov 30 10:01:28 2018 +1000

    gutterrendererchunk: Update to new popup API and fix positioning

 meld/gutterrendererchunk.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 7dbc95e3..9efac262 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -205,9 +205,13 @@ class GutterRendererChunkAction(
             self.filediff.delete_chunk(self.from_pane, chunk)
         elif action == MODE_INSERT:
             copy_menu = self._make_copy_menu(chunk)
-            # TODO: Need a custom GtkMenuPositionFunc to position this next to
-            # the clicked gutter, not where the cursor is
-            copy_menu.popup(None, None, None, None, 0, event.time)
+            copy_menu.popup_at_rect(
+                self.get_view().get_window(self.get_window_type()),
+                area,
+                Gdk.Gravity.SOUTH_WEST,
+                Gdk.Gravity.NORTH_WEST,
+                None,
+            )
         elif action == MODE_REPLACE:
             self.filediff.replace_chunk(self.from_pane, self.to_pane, chunk)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]