Skip to content

Fix hover tooltip for layout containers#7909

Open
optozorax wants to merge 5 commits intoemilk:mainfrom
optozorax:reproduce-horizontal-tooltip-regression-from-main
Open

Fix hover tooltip for layout containers#7909
optozorax wants to merge 5 commits intoemilk:mainfrom
optozorax:reproduce-horizontal-tooltip-regression-from-main

Conversation

@optozorax
Copy link
Copy Markdown
Contributor

@optozorax optozorax commented Feb 14, 2026

I have found that ui.horizontal(...).response.on_hover_text(...) doesn't work, although documentation says otherwise:

The returned Response will only have checked for mouse hover but can be used for tooltips (on_hover_text). It also contains the Rect used by the horizontal layout.The returned Response will only have checked for mouse hover but can be used for tooltips (on_hover_text). It also contains the Rect used by the horizontal layout.

So I added fix to this into tooltip, but this looks like a hack, and I don't know a better place to do so. Do you have a better idea?

This PR is split into two commits: first commit adds test, and you can see wrong behaviour in the image. Second commit fixes this and also regenerates the image and you can now see tooltip.

I have used LLM to help me with this PR (codex). And I retained LLM comment, because such hacks should have some comments, and it seems ok to me.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 14, 2026

Preview available at https://egui-pr-preview.github.io/pr/7909-reproduce-horizontal-tooltip-regression-from-main
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

@optozorax
Copy link
Copy Markdown
Contributor Author

Hi, @emilk , can you please take a look at this PR?

@optozorax optozorax force-pushed the reproduce-horizontal-tooltip-regression-from-main branch from 1ae0d2e to c37b992 Compare March 26, 2026 00:02
@optozorax
Copy link
Copy Markdown
Contributor Author

@emilk done!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hum - I wanted to test that the tooltip for B pops up, but in this case I think we just hit the logic of "keep the previous tooltip open"? I think this needs to be a separate test then

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.

2 participants