Draft
Conversation
…ples from the issue
set_max_width and set_max_height will limit intrinsic size but not max_rect itself
…ure-widget-size # Conflicts: # crates/egui/src/ui.rs # crates/egui/src/widgets/button.rs # crates/egui/src/widgets/label.rs # crates/egui_demo_lib/src/demo/popups.rs # crates/egui_extras/src/layout.rs # crates/epaint/src/text/text_layout_types.rs
|
Preview available at https://egui-pr-preview.github.io/pr/5831-lucasexperimentsmeasure-widget-size |
# Conflicts: # crates/egui/src/atomics/atom.rs # crates/egui/src/atomics/atom_kind.rs # crates/egui/src/atomics/atom_layout.rs # crates/egui/src/containers/sides.rs # crates/egui/src/placer.rs # crates/egui/src/widgets/label.rs # crates/egui/src/widgets/selected_label.rs # crates/egui_demo_lib/src/demo/dancing_strings.rs # crates/egui_extras/src/layout.rs # crates/epaint/src/text/text_layout_types.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cross_intrinsic_sizebookkeeping in Placer #5762This is an attempt at fixing #5138 by bookkeeping an
intrinsic_sizein the placer that is then used by theAreato set the max_rect on the next frame.This should allow us to remove the
sizing_pass, meaningAreacan dynamically adjust to the content size while supporting justified and centered layouts.This is very much WIP and there are still lots of open questions.
From my expermimentation it seems the biggest risk here is correctly implementing the intrinsic size calculation for every widget and container, which today can't be done automatically since every widget does it's own thing here (e.g. Button has right_text and image, which need to be handled correctly). This took me on a detour finding a abstraction on intra widget layout, resulting in #5830, which is very exiting in general and should also make building custom widgets a lot easier.
This layout thing could then also implement the intrinsic size calculation, meaning we only need to calculate it separately for containers.
Having the instrinsic size should also allow future improvements in other areas, e.g. making
ui.horizontalsmarter by looking at last frames intrinsic size and improving egui_flex support foradd_ui