Skip to content
Snippets Groups Projects
Commit 8622fc1b authored by nkour's avatar nkour
Browse files

[gjc] move popups up if out of screen

parent b381276a
No related branches found
No related tags found
No related merge requests found
......@@ -384,9 +384,17 @@ def position_menu_under_button(self, menu):
window_x, window_y = self.window.window.get_origin()
x = window_x + button_x
y = window_y + button_y
# now move the menu below the button
y += button.allocation.height
menu_width, menu_height = menu.size_request()
## should we pop down or up?
if (y + button.allocation.height + menu_height
< gtk.gdk.screen_height()):
# now move the menu below the button
y += button.allocation.height
else:
# now move the menu above the button
y -= menu_height
# push_in is True so all menu is always inside screen
push_in = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment