pub enum SizeToContent {
Off,
Height,
}Expand description
Whether an OS window resizes itself to fit its content’s intrinsic height.
Off (default) keeps the window at its configured
size. Height fixes the width and grows or shrinks
the height to the content’s natural height — the modal-dialog case, e.g. a
MessageBox whose “Show details” expander adds text.
The window never shrinks below its min_size
floor, and its width is left untouched. Intended for a window with a single
primary content root (a dialog). The content’s height must NOT depend on the
window’s own height (e.g. a signal bound to the window size), or the
measure → resize loop may fail to converge. On Wayland only the size
round-trips (position is compositor-owned), which is fine — size-to-content
changes only size.
(A width / both-axes mode is intentionally not offered: no consumer needs
it, and a half-wired variant would silently behave like Height.)
Variants§
Off
The window keeps its configured size (the default).
Height
Width is fixed; height follows the content’s intrinsic height.
Implementations§
Source§impl SizeToContent
impl SizeToContent
Sourcepub fn sizes_height(self) -> bool
pub fn sizes_height(self) -> bool
The window sizes its height to the content.
Trait Implementations§
Source§impl Clone for SizeToContent
impl Clone for SizeToContent
Source§fn clone(&self) -> SizeToContent
fn clone(&self) -> SizeToContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more