TiledLinearGradient

Struct TiledLinearGradient 

Source
pub struct TiledLinearGradient { /* private fields */ }
Expand description

Tiled linear gradient.

Can be used as a node that fills the available space with the gradient tiles, or can continue building a tiled linear gradient.

Use LinearGradient::tile to build.

Implementations§

Source§

impl TiledLinearGradient

Source

pub fn tile_spacing(self, spacing: impl IntoVar<Size>) -> TiledLinearGradient

Set the space between tiles.

Relative values are resolved on the tile size, so setting this to 100.pct() will skip a tile.

Leftover values are resolved on the space taken by tiles that do not fully fit in the available space, so setting this to 1.lft() will cause the border tiles to always touch the full bounds and the middle filled with the maximum full tiles that fit or empty space.

Source

pub fn tile_origin(self, origin: impl IntoVar<Point>) -> TiledLinearGradient

Sets the tile offset.

Relative values are resolved on the tile size, so setting this to 100.pct() will offset a full turn.

Trait Implementations§

Source§

impl UiNodeImpl for TiledLinearGradient

Source§

fn children_len(&self) -> usize

Gets the current count of children nodes.
Source§

fn with_child(&mut self, _: usize, _: &mut dyn FnMut(&mut UiNode))

Visit a child node by index. If the index is not valid visitor is not called. Read more
Source§

fn init(&mut self)

Initializes the node in a new UI context. Read more
Source§

fn update(&mut self, _: &WidgetUpdates)

Receives variable and other non-event updates. Read more
Source§

fn measure(&mut self, _: &mut WidgetMeasure) -> PxSize

Computes the widget size given the contextual layout metrics without actually updating the widget layout. Read more
Source§

fn layout(&mut self, _: &mut WidgetLayout) -> PxSize

Computes the widget layout given the contextual layout metrics. Read more
Source§

fn render(&mut self, frame: &mut FrameBuilder)

Generates render instructions and updates transforms and hit-test areas. Read more
Source§

fn is_list(&self) -> bool

Gets if the node represents a list of other nodes. Read more
Source§

fn for_each_child(&mut self, visitor: &mut dyn FnMut(usize, &mut UiNode))

Call visitor for each child node of self, one at a time. Read more
Source§

fn try_for_each_child( &mut self, visitor: &mut dyn FnMut(usize, &mut UiNode) -> ControlFlow<BoxAnyVarValue>, ) -> ControlFlow<BoxAnyVarValue>

Call visitor for each child node of self, one at a time, with control flow. Read more
Source§

fn par_each_child(&mut self, visitor: &(dyn Fn(usize, &mut UiNode) + Sync))

Calls visitor for each child node in parallel. Read more
Source§

fn par_fold_reduce( &mut self, identity: BoxAnyVarValue, fold: &(dyn Fn(BoxAnyVarValue, usize, &mut UiNode) -> BoxAnyVarValue + Sync), reduce: &(dyn Fn(BoxAnyVarValue, BoxAnyVarValue) -> BoxAnyVarValue + Sync), ) -> BoxAnyVarValue

Calls fold for each child node in parallel, with fold accumulators produced by cloning identity, then merges the folded results using reduce to produce the final value also in parallel. Read more
Source§

fn deinit(&mut self)

Deinitializes the node in the current UI context. Read more
Source§

fn info(&mut self, info: &mut WidgetInfoBuilder)

Builds widget info. Read more
Source§

fn event(&mut self, update: &EventUpdate)

Receives an event. Read more
Source§

fn update_list( &mut self, updates: &WidgetUpdates, observer: &mut dyn UiNodeListObserver, )

Does update and if the node is a list notifies list changes to the observer.
Source§

fn measure_list( &mut self, wm: &mut WidgetMeasure, measure: &(dyn Fn(usize, &mut UiNode, &mut WidgetMeasure) -> Size2D<Px, Px> + Sync), fold_size: &(dyn Fn(Size2D<Px, Px>, Size2D<Px, Px>) -> Size2D<Px, Px> + Sync), ) -> Size2D<Px, Px>

If the node is_list measure each child and combine the size using fold_size. Read more
Source§

fn layout_list( &mut self, wl: &mut WidgetLayout, layout: &(dyn Fn(usize, &mut UiNode, &mut WidgetLayout) -> Size2D<Px, Px> + Sync), fold_size: &(dyn Fn(Size2D<Px, Px>, Size2D<Px, Px>) -> Size2D<Px, Px> + Sync), ) -> Size2D<Px, Px>

If the node is_list layout each child and combine the size using fold_size. Read more
Source§

fn render_list( &mut self, frame: &mut FrameBuilder, render: &(dyn Fn(usize, &mut UiNode, &mut FrameBuilder) + Sync), )

If the node is_list render each child. Read more
Source§

fn render_update(&mut self, update: &mut FrameUpdate)

Updates values in the last generated frame. Read more
Source§

fn render_update_list( &mut self, update: &mut FrameUpdate, render_update: &(dyn Fn(usize, &mut UiNode, &mut FrameUpdate) + Sync), )

If the node is_list render_update each child. Read more
Source§

fn as_widget(&mut self) -> Option<&mut (dyn WidgetUiNodeImpl + 'static)>

Gets the node implementation as a WidgetUiNodeImpl, if the node defines a widget instance scope.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<U> IntoUiNode for U
where U: UiNodeImpl,

Source§

fn into_node(self) -> UiNode

Instantiate the UI node.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> StateValue for T
where T: Any + Send + Sync,