Struct zng_app::widget::info::WidgetInlineMeasure
source · pub struct WidgetInlineMeasure {
pub first: PxSize,
pub first_wrapped: bool,
pub first_segs: Arc<Vec<InlineSegment>>,
pub last: PxSize,
pub last_wrapped: bool,
pub last_segs: Arc<Vec<InlineSegment>>,
}
Expand description
Info about the input inline connecting rows of the widget.
Fields§
§first: PxSize
Preferred first size.
In left-to-right direction the origin is top_left
, in right-to-left direction the origin is top_right - first.width
.
first_wrapped: bool
Indicates that first
starts in the next row, not in the current row defined by the inline constraints.
first_segs: Arc<Vec<InlineSegment>>
Inline segments in the first row.
The sum of segment widths must be less or equal to the first.width
.
last: PxSize
Preferred last size.
In left-to-right direction the origin is bottom_left - last.height
, in right-to-left direction
the origin is bottom_right - last
.
Must be equal to first
if did not wrap.
Must not be empty if first is not empty, that is, must not wrap if the last item can fit in the previous row.
last_wrapped: bool
Indicates that last
starts in a next row, not in the same row as the first.
last_segs: Arc<Vec<InlineSegment>>
Inline segments in the last row.
The sum of segment widths must be less or equal to the last.width
.
Implementations§
source§impl WidgetInlineMeasure
impl WidgetInlineMeasure
sourcepub fn with_first_segs(&mut self, f: impl FnOnce(&mut Vec<InlineSegment>))
pub fn with_first_segs(&mut self, f: impl FnOnce(&mut Vec<InlineSegment>))
Visit a mutable reference to the new first_segs
value, f
is called with
an empty vec that can be reused or new.
sourcepub fn with_last_segs(&mut self, f: impl FnOnce(&mut Vec<InlineSegment>))
pub fn with_last_segs(&mut self, f: impl FnOnce(&mut Vec<InlineSegment>))
Visit a mutable reference to the new last_segs
value, f
is called with
an empty vec that can be reused or new.
sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
If all value are not different from initial.
This indicates the widget has not handled the inline config yet.
Trait Implementations§
source§impl Clone for WidgetInlineMeasure
impl Clone for WidgetInlineMeasure
source§fn clone(&self) -> WidgetInlineMeasure
fn clone(&self) -> WidgetInlineMeasure
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WidgetInlineMeasure
impl Debug for WidgetInlineMeasure
source§impl Default for WidgetInlineMeasure
impl Default for WidgetInlineMeasure
source§fn default() -> WidgetInlineMeasure
fn default() -> WidgetInlineMeasure
source§impl PartialEq for WidgetInlineMeasure
impl PartialEq for WidgetInlineMeasure
impl StructuralPartialEq for WidgetInlineMeasure
Auto Trait Implementations§
impl Freeze for WidgetInlineMeasure
impl RefUnwindSafe for WidgetInlineMeasure
impl Send for WidgetInlineMeasure
impl Sync for WidgetInlineMeasure
impl Unpin for WidgetInlineMeasure
impl UnwindSafe for WidgetInlineMeasure
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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