changeset 922d66465fe1 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=922d66465fe1 description: fix popup emoticons menu coordinates
diffstat:
src/gtkgui_helpers.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 263cf1c24c6a -r 922d66465fe1 src/gtkgui_helpers.py --- a/src/gtkgui_helpers.py Thu Jan 03 17:26:12 2013 +0400 +++ b/src/gtkgui_helpers.py Thu Jan 03 19:39:04 2013 +0400 @@ -124,17 +124,22 @@ Popup the emoticons menu under button, which is in parent_win """ window_x1, window_y1 = parent_win.get_origin()[1:] + def position_menu_under_button(menu, data): # inline function, which will not keep refs, when used as CB alloc = button.get_allocation() button_x, button_y = alloc.x, alloc.y - + translated_coordinates = button.translate_coordinates( + gajim.interface.roster.window, 0, 0) + if translated_coordinates: + button_x, button_y = translated_coordinates + _alloc = parent_win.notebook.get_allocation() # now convert them to X11-relative window_x, window_y = window_x1, window_y1 x = window_x + button_x y = window_y + button_y
- menu_height = menu.size_request()[1] + menu_height = menu.size_request().height
## should we pop down or up? if (y + alloc.height + menu_height < Gdk.Screen.height()):