[−][src]Struct kas::AlignHints
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 kas::Layout::set_rect
:
let pref_size = Size(30, 20); // usually size comes from SizeHandle let rect = align .complete(Align::Stretch, Align::Centre, pref_size) .apply(rect); // self.core.rect = rect;
Fields
horiz: Option<Align>
vert: Option<Align>
Implementations
impl AlignHints
[src]
pub const NONE: AlignHints
[src]
No hints
pub const fn new(horiz: Option<Align>, vert: Option<Align>) -> Self
[src]
Construct with optional horiz. and vert. alignment
pub fn unwrap_or(self, horiz: Align, vert: Align) -> (Align, Align)
[src]
Unwrap type's alignments or substitute parameters
pub fn complete(
&self,
horiz: Align,
vert: Align,
ideal: Size
) -> CompleteAlignment
[src]
&self,
horiz: Align,
vert: Align,
ideal: Size
) -> CompleteAlignment
Complete via defaults and ideal size information
Trait Implementations
impl Clone for AlignHints
[src]
pub fn clone(&self) -> AlignHints
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for AlignHints
[src]
impl Debug for AlignHints
[src]
impl Default for AlignHints
[src]
pub fn default() -> AlignHints
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,