-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
add tooltips to blocks #4451
base: master
Are you sure you want to change the base?
add tooltips to blocks #4451
Conversation
0994040
to
66cff28
Compare
66cff28
to
18c621e
Compare
I don't think it's necessary to add |
ready for review! the tests only fail because i modified the tooltip reference image to include a centered tooltip for an axis. the image just needs to be updated |
5efc102
to
23e55c0
Compare
hovering fields have been removed from all blocks and mouseposition is compared to bbox as @jkrumbiegel suggested. tooltips can now be always shown, never shown, or only shown when hovered. i don't know how best to add a delay when hovering, and since this is a feature i wouldn't use, i chose not to pursue it. if this is important, please suggest a way and i can add. |
here's how i use this PR: Screen.Recording.2024-10-28.at.11.46.02.AM.mov
in actual usage, i also save the state of the toggle using Preferences.jl. when the user loads the package for the first time ever, the state is on and all tooltips are displayed on hover. if they then turn it off, this is remembered the next time and all subsequent times they load the package. like this with GLMakie:
and this with Bonito:
|
@ffreyer in the video above you can see the rendering weirdness with tooltip I was talking about before. The stroke of the little triangle is halved and jagged for some reason @bjarthur I like this implementation better already. I think it still needs a delay setting (which you of course can set to 0 if you prefer that) but it would get out of your way more if you didn't have to toggle it on and off, but could leave it on and tooltips would display smartly. I'm also not quite sure if it's good to show the tooltip on the outside of the block, that can work ok for smaller ones but for bigger ones it might look a bit awkward, and also drags attention away from the user's cursor (which is where they're currently attending). So I'd probably mirror the more typical behavior in browsers where the tooltip appears right next to the cursor. Like this: Screen.Recording.2024-10-30.at.10.12.10.mov |
23e55c0
to
7fafe05
Compare
delay to display and following the cursor now implemented in most recent two commits. anything else? |
delay really slows down GUI. need to refactor to minimize calls to |
Yea and this is what I thought I fixed. And for me it is fixed in GLMakie, WGLMakie: |
WGLMakie tooltips used to render correctly for me back in v0.21.8, and then broke a with one of the updates. I just pulled in the latest version v0.21.15 and the triangle is still wrong in WGLMakie. Pushed a fix that works for me #4560, but I think it’s more of a hack than an actual fix. |
@ffreyer do you recall the commit in which you fixed the tooltip triangle? I wonder if that fix was OS specific for whatever reason. |
This reverts commit d6abeaf.
7fafe05
to
0358860
Compare
alright, it's really stripped down now! let me know what you think. |
supersedes #4380
adds tooltips to Textboxes which appear on hover. API is a new
tooltip!(::Block)
method as proposed by @jkrumbiegel in #4380 (comment)those blocks which do not already have a
hovering
field will need to be modified to have one.currently only Textbox is known to work. will get to the others shortly.
Type of change
Delete options that do not apply:
Checklist