Skip to content

Fix hover tooltip for layout containers#7909

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

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

Conversation

@optozorax
Copy link
Contributor

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

The returned [Response](https://docs.rs/egui/latest/egui/response/struct.Response.html) will only have checked for mouse hover but can be used for tooltips (on_hover_text). It also contains the [Rect](https://docs.rs/egui/latest/egui/struct.Rect.html) used by the horizontal layout.The returned [Response](https://docs.rs/egui/latest/egui/response/struct.Response.html) will only have checked for mouse hover but can be used for tooltips (on_hover_text). It also contains the [Rect](https://docs.rs/egui/latest/egui/struct.Rect.html) 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

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

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