zng_app::widget::builder

Struct NestGroup

source
pub struct NestGroup(/* private fields */);
Expand description

Property nest position group.

Each group has u16::MAX / 9 in between, custom groups can be created using the +/- operations, SIZE+1 is still outside BORDER, but slightly inside SIZE.

See NestPosition for more details.

Implementations§

source§

impl NestGroup

source

pub const WIDGET: NestGroup = _

Minimal nest position, property is outside even context properties and is only inside the widget node.

This is rarely used, prefer using CONTEXT-n if you must have a property outside the widget context.

source

pub const CONTEXT: NestGroup = _

Property defines a contextual value or variable.

Usually these properties don’t define behavior, they just configure the widget. A common pattern is defining all widget config as context vars, that are all used by a widget intrinsic node.

These properties are not expected to affect layout or render, if they do some errors may be logged by the default widget base.

source

pub const EVENT: NestGroup = _

Property defines an event handler, or state monitor, they are placed inside all context properties, so can be configured by context, but are still outside of the layout and render nodes.

Event handlers can be notified before or after the inner child delegation, if handled before the event is said to be preview. Implementers can use this intrinsic feature of the UI tree to interrupt notification for child properties and widgets.

These properties are not expected to affect layout or render, if they do some errors may be logged by the default widget base.

source

pub const LAYOUT: NestGroup = _

Property defines the position and size of the widget inside the space made available by the parent widget.

These properties must accumulatively affect the measure and layout, they must avoid rendering. The computed layout is usually rendered by the widget as a single transform, the layout properties don’t need to render transforms.

source

pub const SIZE: NestGroup = _

Property strongly enforces a widget size.

Usually the widget final size is a side-effect of all the layout properties, but some properties may enforce a size, they can use this group to ensure that they are inside the other layout properties.

source

pub const WIDGET_INNER: NestGroup = _

Minimal widget visual position, any property or node can render, but usually only properties inside this position render. For example, borders will only render correctly inside this nest position.

This is rarely used, prefer using BORDER-n to declare properties that are visually outside the bounds, only use this node for intrinsics that define some inner context or service for the visual properties.

source

pub const BORDER: NestGroup = _

Property renders a border visual.

Borders are strictly coordinated, see the border module for more details. All nodes of this group may render at will, the renderer is already configured to apply the final layout and size.

source

pub const FILL: NestGroup = _

Property defines a visual of the widget.

This is the main render group, it usually defines things like a background fill, but it can render over child nodes simply by choosing to render after the render is delegated to the inner child.

source

pub const CHILD_CONTEXT: NestGroup = _

Property defines contextual value or variable for the inner child or children widgets. Config set here does not affect the widget where it is set, it only affects the descendants.

source

pub const CHILD_LAYOUT: NestGroup = _

Property defines the layout and size of the child or children widgets. These properties don’t affect the layout of the widget where they are set. Some properties are functionally the same, only changing their effect depending on their group, the margin and padding properties are like this, margin is LAYOUT and padding is CHILD_LAYOUT.

source

pub const CHILD: NestGroup = _

Maximum nest position, property is inside all others and only wraps the widget child node.

Properties that insert child nodes may use this group, properties that only affect the child layout and want to be inside other child layout should use CHILD_LAYOUT+n instead.

source

pub const ITEMS: [Self; 11] = _

All groups, from outermost(WIDGET) to innermost(CHILD).

source

pub fn name(self) -> Txt

Group name.

Trait Implementations§

source§

impl Add<i16> for NestGroup

source§

type Output = NestGroup

The resulting type after applying the + operator.
source§

fn add(self, rhs: i16) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<i16> for NestGroup

source§

fn add_assign(&mut self, rhs: i16)

Performs the += operation. Read more
source§

impl Clone for NestGroup

source§

fn clone(&self) -> NestGroup

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NestGroup

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NestGroup

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for NestGroup

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for NestGroup

source§

type Err = String

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Ord for NestGroup

source§

fn cmp(&self, other: &NestGroup) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for NestGroup

source§

fn eq(&self, other: &NestGroup) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NestGroup

source§

fn partial_cmp(&self, other: &NestGroup) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for NestGroup

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Sub<i16> for NestGroup

source§

type Output = NestGroup

The resulting type after applying the - operator.
source§

fn sub(self, rhs: i16) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<i16> for NestGroup

source§

fn sub_assign(&mut self, rhs: i16)

Performs the -= operation. Read more
source§

impl Copy for NestGroup

source§

impl Eq for NestGroup

source§

impl StructuralPartialEq for NestGroup

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> AnyVarValue for T
where T: VarValue,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Access to dyn Any methods.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Access to mut dyn Any methods.
source§

fn clone_boxed(&self) -> Box<dyn AnyVarValue>

Clone the value.
source§

fn clone_boxed_var(&self) -> Box<dyn AnyVar>

Clone the value into a new boxed LocalVar<Self>.
source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Access to Box<dyn Any> methods.
source§

fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool

Gets if self equals other.
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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<T> IntoVar<T> for T
where T: VarValue,

source§

type Var = LocalVar<T>

Variable type that will wrap the T value. Read more
source§

fn into_var(self) -> <T as IntoVar<T>>::Var

Converts the source value into a var.
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
§

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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> ToTxt for T
where T: ToString,

source§

fn to_txt(&self) -> Txt

Converts the given value to an owned Txt. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> IntoValue<T> for T
where T: VarValue,

source§

impl<T> IpcValue for T
where T: Debug + Serialize + for<'d> Deserialize<'d> + Send + 'static,

source§

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

source§

impl<T> VarValue for T
where T: Debug + Clone + PartialEq + Any + Send + Sync,