Skip to content

Include popups and tooltips in Harness::fit_contents#7556

Merged
lucasmerlin merged 5 commits intomainfrom
gijs/improve-fit-contents
Sep 23, 2025
Merged

Include popups and tooltips in Harness::fit_contents#7556
lucasmerlin merged 5 commits intomainfrom
gijs/improve-fit-contents

Conversation

@oxkitsune
Copy link
Collaborator

This makes Harness::fit_contents also use popups and tooltips to compute the size of the contents.

@github-actions
Copy link

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

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.

Would be nice with an actual snapshot test to test this

Comment on lines +281 to +286
// Start with the standard response rect
let mut used = if let Some(response) = self.response.as_ref() {
response.rect
} else {
return None;
};
Copy link
Owner

Choose a reason for hiding this comment

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

alternative, that will still work in case of no response, but when there are areas. Though needs handling in case there are no areas

Suggested change
// Start with the standard response rect
let mut used = if let Some(response) = self.response.as_ref() {
response.rect
} else {
return None;
};
// Start with the standard response rect
let mut used = if let Some(response) = self.response.as_ref() {
response.rect
} else {
Rect::NOTHING
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to retain the current behavior in case of no response.

@lucasmerlin lucasmerlin merged commit 48d903d into main Sep 23, 2025
47 checks passed
@lucasmerlin lucasmerlin deleted the gijs/improve-fit-contents branch September 23, 2025 09:03
podusowski pushed a commit to podusowski/egui that referenced this pull request Oct 10, 2025
This makes `Harness::fit_contents` also use popups and tooltips to
compute the size of the contents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants