Use hippo.CanvasContext.translate_to_screen() for positioning popups.
This commit is contained in:
parent
c9af045e43
commit
d4639a1764
@ -296,8 +296,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
||||
|
||||
if [x, y] == [None, None]:
|
||||
context = self.get_context()
|
||||
#[x, y] = context.translate_to_screen(self)
|
||||
[x, y] = context.translate_to_widget(self)
|
||||
[x, y] = context.translate_to_screen(self)
|
||||
|
||||
# TODO: Any better place to do this?
|
||||
popup.props.box_width = max(popup.props.box_width,
|
||||
|
@ -150,8 +150,7 @@ class OptionMenu(hippo.CanvasBox, hippo.CanvasItem):
|
||||
self._menu.hide()
|
||||
else:
|
||||
context = self._round_box.get_context()
|
||||
#[x, y] = context.translate_to_screen(self._round_box)
|
||||
[x, y] = context.translate_to_widget(self._round_box)
|
||||
[x, y] = context.translate_to_screen(self._round_box)
|
||||
|
||||
# TODO: Any better place to do this?
|
||||
self._menu.props.box_width = self.get_width_request()
|
||||
|
Loading…
Reference in New Issue
Block a user