do it in an easier way
This commit is contained in:
parent
8017a9d3cb
commit
a7ee9425be
|
@ -354,12 +354,9 @@ class Chat:
|
||||||
menu.show_all()
|
menu.show_all()
|
||||||
|
|
||||||
def position_actions_menu(self, menu):
|
def position_actions_menu(self, menu):
|
||||||
# here I get the coordinates of the button using
|
# here I get the coordinates of the button relative to
|
||||||
# translate_coordinates and by passing 0, 0 so I go from
|
# window (self.window)
|
||||||
# top-left of window (self.window) to top-left of button
|
button_x, button_y = self.actions_button.allocation.x, self.actions_button.allocation.y
|
||||||
button_x, button_y = \
|
|
||||||
self.actions_button.translate_coordinates(
|
|
||||||
self.window, 0, 0)
|
|
||||||
|
|
||||||
# now convert them to X11-relative
|
# now convert them to X11-relative
|
||||||
window_x, window_y = self.window.window.get_origin()
|
window_x, window_y = self.window.window.get_origin()
|
||||||
|
|
Loading…
Reference in New Issue