Page MenuHomePhabricator

Elementary window mode (out-of-window) tooltips don't display correctly when the tooltip doesn't fit in the default top-left location
Closed, ResolvedPublic

Description

Example code in Python:

from efl import elementary as elm
elm.policy_set(elm.ELM_POLICY_QUIT, elm.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)
win = elm.StandardWindow("test", "test", autodel=True, size=(200, 200))
btn = elm.Button(win, size_hint_weight=(1.0, 1.0), text="Hover over me!")

tooltip_text = elm.utf8_to_markup(
"""BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH""")

btn.tooltip_text_set(tooltip_text)
btn.tooltip_window_mode_set(True)
win.resize_object_add(btn)
btn.show()
win.show()
elm.run()

If you have the app window near the top left corner of your screen, so that the tooltip area doesn't fit on the screen at its default location, the tooltip attempts to draw but only displays a fade in/fade out animation.

Moving the app window away from the screen edges allows the default tooltip area to fit, and the tooltip draws correctly.

kuuko created this task.Aug 3 2016, 3:25 AM
kuuko reopened this task as Open.Aug 5 2016, 11:02 AM

Ummm I don't think it's quite working as intended yet. The tooltip gets positioned entirely outside the window, when there's plenty of space immediately next to the cursor.

See here, I'm hovering my mouse cursor near the left edge of the app window so there's a huge difference to where you'd expect to see the tooltip.

raster added a comment.Aug 5 2016, 5:59 PM

that's actually kind of part of the tooltip policy - even before. to try and not completely overlap the object regardless of cursor. cursor is used to align the tooltip around the edges of the object. i didnt create that original policy - just made it work... :)

kuuko added a comment.Aug 5 2016, 10:45 PM

Does this mean that tooltip positioning is broken when there is room in the default orientation, as it now does overlap the parent?

https://www.youtube.com/watch?v=hi3Tt2Skon8

theres some complex logic to handle if the mouse is inside or outside the object and if the tooltip fits -if it doesnt fit it gets placed beside,. if beside doesnt fit it will overlap again. atm it works and displays and there are impossible cases like tooltip exceeds screen size and so on... i dislike positioning tooltip next to the content but thats what the code had and tried to do. the simple one is to use mouse pos Or center of obj if mouse pos not useful and then hover to some direction from the mouse pos.

kuuko closed this task as Resolved.Aug 6 2016, 3:19 AM
kuuko claimed this task.

Right, it's working as intended then. Thanks for the fix and explanation!

raster added a comment.Aug 6 2016, 3:25 AM

just fyi - CHANGING the implementation to be different is a different matter... and that's possibly a good idea. but not right now :)