Skip to content

Commit 44f7792

Browse files
committed
misc: Remove now-unused custom popup positioning helper
1 parent de91dad commit 44f7792

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

meld/misc.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -143,43 +143,6 @@ def wrap_function(locked, *args, **kwargs):
143143
return wrap
144144

145145

146-
# Taken from epiphany
147-
def position_menu_under_widget(menu, x, y, widget):
148-
container = widget.get_ancestor(Gtk.Container)
149-
150-
widget_width = widget.get_allocation().width
151-
menu_width = menu.get_allocation().width
152-
menu_height = menu.get_allocation().height
153-
154-
screen = menu.get_screen()
155-
monitor_num = screen.get_monitor_at_window(widget.get_window())
156-
if monitor_num < 0:
157-
monitor_num = 0
158-
monitor = screen.get_monitor_geometry(monitor_num)
159-
160-
unused, x, y = widget.get_window().get_origin()
161-
allocation = widget.get_allocation()
162-
if not widget.get_has_window():
163-
x += allocation.x
164-
y += allocation.y
165-
166-
if container.get_direction() == Gtk.TextDirection.LTR:
167-
x += allocation.width - widget_width
168-
else:
169-
x += widget_width - menu_width
170-
171-
if (y + allocation.height + menu_height) <= monitor.y + monitor.height:
172-
y += allocation.height
173-
elif (y - menu_height) >= monitor.y:
174-
y -= menu_height
175-
elif monitor.y + monitor.height - (y + allocation.height) > y:
176-
y += allocation.height
177-
else:
178-
y -= menu_height
179-
180-
return (x, y, False)
181-
182-
183146
def make_tool_button_widget(label):
184147
"""Make a GtkToolButton label-widget suggestive of a menu dropdown"""
185148
arrow = Gtk.Arrow(

0 commit comments

Comments
 (0)