Skip to content
Discussion options

You must be logged in to vote

You can build this with the current layout callback and Window::resize: measure an intrinsic-height content child, then defer resizing the window while preserving its current width.

In GPUI Kit 0.8.0, Div::on_children_prepainted gives you the resolved child bounds. Put padding inside that child and avoid h_full()/flex_1() on it, so its height comes from the content. Window::resize takes the content size; there is no titlebar offset to add. Recheck the width before applying the deferred measurement, and only resize when the height changes.

Here is a runnable example with Add/Remove/Reset controls and wrapping text. cargo run --locked -- --verify opens a real native window and exercises tho…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@love-linger
Comment options

Answer selected by love-linger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants