Struct zng_app::widget::info::WidgetInlineInfo
source · pub struct WidgetInlineInfo {
pub rows: Vec<PxRect>,
pub first_segs: Vec<InlineSegmentInfo>,
pub last_segs: Vec<InlineSegmentInfo>,
pub inner_size: PxSize,
/* private fields */
}
Expand description
Info about the inlined rows of the widget.
Fields§
§rows: Vec<PxRect>
Last layout rows of the widget.
The rectangles are in the widget’s inner space, from top to bottom.
first_segs: Vec<InlineSegmentInfo>
Segments of the first row.
If this is empty the entire row width is a continuous segment, otherwise the row is segmented and the widget can be interleaved with sibling widgets due to Unicode bidirectional text sorting algorithm.
Note that the segment count may be less then WidgetInlineMeasure::first_segs
as contiguous segments
may be merged.
The segments are from left to right.
last_segs: Vec<InlineSegmentInfo>
Segments of the last row.
inner_size: PxSize
Widget inner size when the rows where last updated.
Implementations§
source§impl WidgetInlineInfo
impl WidgetInlineInfo
sourcepub fn set_first_segs(&mut self, segs: impl Iterator<Item = InlineSegmentInfo>)
pub fn set_first_segs(&mut self, segs: impl Iterator<Item = InlineSegmentInfo>)
Replace the first_segs
with segs
.
The segments are sorted when needed, but prefer inputs that are mostly sorted.
The segments are merged when there is no gap or there is a small one pixel overlap to the previous segment.
sourcepub fn set_last_segs(&mut self, segs: impl Iterator<Item = InlineSegmentInfo>)
pub fn set_last_segs(&mut self, segs: impl Iterator<Item = InlineSegmentInfo>)
Replace the last_segs
with segs
.
The segments are sorted when needed, but prefer inputs that are mostly sorted.
The segments are merged when there is no gap or there is a small one pixel overlap to the previous segment.
sourcepub fn negative_space(&self) -> Arc<Vec<PxRect>>
pub fn negative_space(&self) -> Arc<Vec<PxRect>>
Gets or computes the negative space of the rows
in the inner_size
space, that is, all the areas that are
not covered by any row and not covered by the first and last row segments.
This is computed on demand and cached.
sourcepub fn invalidate_negative_space(&mut self)
pub fn invalidate_negative_space(&mut self)
Invalidates the negative_space
cache.
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 WidgetInlineInfo
impl Clone for WidgetInlineInfo
source§impl Debug for WidgetInlineInfo
impl Debug for WidgetInlineInfo
source§impl Default for WidgetInlineInfo
impl Default for WidgetInlineInfo
source§fn default() -> WidgetInlineInfo
fn default() -> WidgetInlineInfo
source§impl PartialEq for WidgetInlineInfo
impl PartialEq for WidgetInlineInfo
Auto Trait Implementations§
impl !Freeze for WidgetInlineInfo
impl !RefUnwindSafe for WidgetInlineInfo
impl Send for WidgetInlineInfo
impl Sync for WidgetInlineInfo
impl Unpin for WidgetInlineInfo
impl UnwindSafe for WidgetInlineInfo
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