From 8622fc1b2d7cff7db47504abde03249ba45fb483 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 16 Nov 2005 09:57:28 +0000 Subject: [PATCH] [gjc] move popups up if out of screen --- src/chat.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/chat.py b/src/chat.py index 06770537c..93798c0f6 100644 --- a/src/chat.py +++ b/src/chat.py @@ -384,9 +384,17 @@ class Chat: 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