Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

emilk
Copy link
Owner

@emilk emilk commented Sep 25, 2024

Affects .on_hover_text(…) with dynamic content (i.e. content that changes over time).

.on_hover_ui with dynamic content can still hit the shrinking problem. The general solution depends on solving #5138 but a work-around is to add this to your tooltips:

 response.on_hover_ui(|ui| {
+    ui.set_max_width(ui.spacing().tooltip_width);
     // …
 });

Affects `.on_hover_text(…)` with dynamic content (i.e. content
that changes over time).

* Closes #5167
@emilk emilk added bug Something is broken layout Related to widget layout egui labels Sep 25, 2024
@github-actions
Copy link

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

@emilk emilk merged commit 3805584 into master Sep 25, 2024
43 checks passed
@emilk emilk deleted the emilk/fix-shrinking-tooltips branch September 25, 2024 16:50
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
Affects `.on_hover_text(…)` with dynamic content (i.e. content that
changes over time).

* Closes emilk#5167

`.on_hover_ui` with dynamic content can still hit the shrinking problem.
The general solution depends on solving
emilk#5138 but a work-around is to add
this to your tooltips:

```diff
 response.on_hover_ui(|ui| {
+    ui.set_max_width(ui.spacing().tooltip_width);
     // …
 });
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken egui layout Related to widget layout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltips with dynamic contents shrink

1 participant