Struct kas::layout::AlignHints [−][src]
Expand description
Partial alignment information provided by the parent
Hints are optional. Widgets are expected to substitute default values where hints are not provided.
The AlignHints::complete
method is provided to conveniently apply
alignment to a widget within crate::Layout::set_rect
:
let pref_size = Size(30, 20); // usually size comes from SizeHandle
let rect = align
.complete(Align::Stretch, Align::Centre)
.aligned_rect(pref_size, rect);
// self.core.rect = rect;
Fields
horiz: Option<Align>
vert: Option<Align>
Implementations
No hints
Construct with optional horiz. and vert. alignment
Unwrap type’s alignments or substitute parameters
Complete via default alignments
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AlignHints
impl Send for AlignHints
impl Sync for AlignHints
impl Unpin for AlignHints
impl UnwindSafe for AlignHints
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more