Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tooltips stay on screen & doesn't get in the way #197

Open
wants to merge 1 commit into
base: v8
Choose a base branch
from

Conversation

MattSturgeon
Copy link
Contributor

@MattSturgeon MattSturgeon commented Mar 12, 2023

When the tooltip is wider than half the screen width, it often ends up partially off-screen.

This PR fixes that by ensuring the tooltip always wraps to less than screen.width / 2.

Additionally, it shifts the tooltip above the cursor, instead of in-line with it. This allows the user to more easily read what they're hovering over without the tooltip getting in the way. Especially multi-line tooltips.

FYI the upcoming 1.19.4 release "Changed how tooltips in the menu UI are positioned so buttons are still readable" in Snapshot 23w05a, so the mouseY - height tooltip shift may be redundant or duplicated once that's released.

When the tooltip is wider than half the screen width, it often ends up
partially off-screen.

Let's ensure the tooltip always wraps to less than `screen.width / 2`.

Additionally, lets render the tooltip above the cursor, instead of
in-line with it. This allows the user to more easily read what they're
hovering over without the tooltip getting in the way.
@MattSturgeon MattSturgeon mentioned this pull request Mar 17, 2023
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant