[meld/deprecation-cleanup: 12/48] misc: Remove now-unused custom popup positioning helper



commit 44f7792d996708040de461f0ea82b682741cb20d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Fri Nov 30 10:05:17 2018 +1000

    misc: Remove now-unused custom popup positioning helper

 meld/misc.py | 37 -------------------------------------
 1 file changed, 37 deletions(-)
---
diff --git a/meld/misc.py b/meld/misc.py
index 6fcd7deb..aa9cf11c 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -143,43 +143,6 @@ def user_critical(primary, message):
     return wrap
 
 
-# Taken from epiphany
-def position_menu_under_widget(menu, x, y, widget):
-    container = widget.get_ancestor(Gtk.Container)
-
-    widget_width = widget.get_allocation().width
-    menu_width = menu.get_allocation().width
-    menu_height = menu.get_allocation().height
-
-    screen = menu.get_screen()
-    monitor_num = screen.get_monitor_at_window(widget.get_window())
-    if monitor_num < 0:
-        monitor_num = 0
-    monitor = screen.get_monitor_geometry(monitor_num)
-
-    unused, x, y = widget.get_window().get_origin()
-    allocation = widget.get_allocation()
-    if not widget.get_has_window():
-        x += allocation.x
-        y += allocation.y
-
-    if container.get_direction() == Gtk.TextDirection.LTR:
-        x += allocation.width - widget_width
-    else:
-        x += widget_width - menu_width
-
-    if (y + allocation.height + menu_height) <= monitor.y + monitor.height:
-        y += allocation.height
-    elif (y - menu_height) >= monitor.y:
-        y -= menu_height
-    elif monitor.y + monitor.height - (y + allocation.height) > y:
-        y += allocation.height
-    else:
-        y -= menu_height
-
-    return (x, y, False)
-
-
 def make_tool_button_widget(label):
     """Make a GtkToolButton label-widget suggestive of a menu dropdown"""
     arrow = Gtk.Arrow(


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