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 moreimpl Copy for SizeToContent
Source§impl Debug for SizeToContent
impl Debug for SizeToContent
Source§impl Default for SizeToContent
impl Default for SizeToContent
Source§fn default() -> SizeToContent
fn default() -> SizeToContent
impl Eq for SizeToContent
Source§impl PartialEq for SizeToContent
impl PartialEq for SizeToContent
impl StructuralPartialEq for SizeToContent
Auto Trait Implementations§
impl Freeze for SizeToContent
impl RefUnwindSafe for SizeToContent
impl Send for SizeToContent
impl Sync for SizeToContent
impl Unpin for SizeToContent
impl UnsafeUnpin for SizeToContent
impl UnwindSafe for SizeToContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more