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

Fix bug causing tooltips with dynamic content to shrink #5168

Merged
merged 1 commit into from
Sep 25, 2024

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
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