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

Support on hover tooltip that is noninteractable even with interactable content #5543

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

Conversation

PPakalns
Copy link
Contributor

@PPakalns
Copy link
Contributor Author

Tested in real use case. Greatly reduces flickering for "preview" tooltips that may contain interactable widgets.

Use case: "Preview" of the page/window that will be opened if the button is pressed.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5543-noninteractivetooltip
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@grtlr
Copy link
Collaborator

grtlr commented Jan 3, 2025

@emilk I ran into a related problem: rerun-io/rerun#8568

It seems like the current logic in should_show_hover_ui does not take into account that the tooltip is drawn in relation to the pointer position. Because of this, the tooltip always remains open since it's shifted at every frame.

In the case of the Rerun graph view, we can simply call on_hover_ui instead of on_hover_ui_at_pointer: rerun-io/rerun#8573

@PPakalns PPakalns force-pushed the noninteractive_tooltip branch from 942690e to ebbf493 Compare January 16, 2025 17:20
@PPakalns
Copy link
Contributor Author

Resolved conflicts.

@PPakalns PPakalns force-pushed the noninteractive_tooltip branch from ebbf493 to 37240f1 Compare January 22, 2025 12:01
@PPakalns
Copy link
Contributor Author

Updated against newest master to rerun checks that failed due to incorrectly configured github pipeline action.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the need for this functionality, but I think it's time to make a builder for tooltips so that we don't get this combinatorial explosion of tooltip methods

@PPakalns
Copy link
Contributor Author

PPakalns commented Jan 27, 2025

I appreciate the need for this functionality, but I think it's time to make a builder for tooltips so that we don't get this combinatorial explosion of tooltip methods

@emilk
I can implement this using builder pattern.

To make sure that I decide the right design for this, feel free to correct me:

Currently we have methods:

on_hover_ui
on_hover_ui_at_pointer
on_disabled_hover_ui

And this PR wants to add parameter to configure if hover (tooltip) ui is interactable.

I could replace these methods with one simple method:

on_hover_ui(HoverBuilder)

Where HoverBuilder has configurable options:

  1. Show at pointer
  2. Show if UI is enabled / disabled
  3. Should hover UI be kept open if mouse moves over it (Is it interactable, can be hovered over)

Does this design seems OK?

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.

Noninteractive tooltip with any content (on_hover_ui)
3 participants