[gjc] move popups up if out of screen

This commit is contained in:
Nikos Kouremenos 2005-11-16 09:57:28 +00:00
parent b381276ac0
commit 8622fc1b2d
1 changed files with 11 additions and 3 deletions

View File

@ -385,8 +385,16 @@ class Chat:
x = window_x + button_x x = window_x + button_x
y = window_y + button_y y = window_y + button_y
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 # now move the menu below the button
y += button.allocation.height 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 is True so all menu is always inside screen
push_in = True push_in = True