WidgetBuilder

Struct WidgetBuilder 

Source
pub struct WidgetBuilder {
Show 29 fields pub name: String, pub width: f32, pub height: f32, pub desired_position: Vector2<f32>, pub vertical_alignment: VerticalAlignment, pub horizontal_alignment: HorizontalAlignment, pub max_size: Option<Vector2<f32>>, pub min_size: Option<Vector2<f32>>, pub background: Option<Brush>, pub foreground: Option<Brush>, pub row: usize, pub column: usize, pub margin: Thickness, pub children: Vec<Handle<UiNode>>, pub is_hit_test_visible: bool, pub visibility: bool, pub z_index: usize, pub allow_drag: bool, pub allow_drop: bool, pub user_data: Option<Rc<dyn Any>>, pub draw_on_top: bool, pub enabled: bool, pub cursor: Option<CursorIcon>, pub opacity: Option<f32>, pub tooltip: Handle<UiNode>, pub tooltip_time: f32, pub context_menu: Handle<UiNode>, pub preview_messages: bool, pub handle_os_events: bool,
}

Fields§

§name: String§width: f32§height: f32§desired_position: Vector2<f32>§vertical_alignment: VerticalAlignment§horizontal_alignment: HorizontalAlignment§max_size: Option<Vector2<f32>>§min_size: Option<Vector2<f32>>§background: Option<Brush>§foreground: Option<Brush>§row: usize§column: usize§margin: Thickness§children: Vec<Handle<UiNode>>§is_hit_test_visible: bool§visibility: bool§z_index: usize§allow_drag: bool§allow_drop: bool§user_data: Option<Rc<dyn Any>>§draw_on_top: bool§enabled: bool§cursor: Option<CursorIcon>§opacity: Option<f32>§tooltip: Handle<UiNode>§tooltip_time: f32§context_menu: Handle<UiNode>§preview_messages: bool§handle_os_events: bool

Implementations§

Source§

impl WidgetBuilder

Source

pub fn new() -> Self

Source

pub fn with_preview_messages(self, state: bool) -> Self

Source

pub fn with_handle_os_events(self, state: bool) -> Self

Source

pub fn with_width(self, width: f32) -> Self

Source

pub fn with_height(self, height: f32) -> Self

Source

pub fn with_enabled(self, enabled: bool) -> Self

Source

pub fn with_vertical_alignment(self, valign: VerticalAlignment) -> Self

Source

pub fn with_horizontal_alignment(self, halign: HorizontalAlignment) -> Self

Source

pub fn with_max_size(self, max_size: Vector2<f32>) -> Self

Source

pub fn with_min_size(self, min_size: Vector2<f32>) -> Self

Source

pub fn with_background(self, brush: Brush) -> Self

Source

pub fn with_foreground(self, brush: Brush) -> Self

Source

pub fn on_row(self, row: usize) -> Self

Source

pub fn on_column(self, column: usize) -> Self

Source

pub fn with_margin(self, margin: Thickness) -> Self

Source

pub fn with_desired_position(self, desired_position: Vector2<f32>) -> Self

Source

pub fn with_z_index(self, z_index: usize) -> Self

Source

pub fn with_child(self, handle: Handle<UiNode>) -> Self

Source

pub fn with_draw_on_top(self, draw_on_top: bool) -> Self

Source

pub fn with_children<I: IntoIterator<Item = Handle<UiNode>>>( self, children: I, ) -> Self

Source

pub fn with_name(self, name: &str) -> Self

Source

pub fn with_hit_test_visibility(self, state: bool) -> Self

Source

pub fn with_visibility(self, visibility: bool) -> Self

Source

pub fn with_allow_drop(self, allow_drop: bool) -> Self

Source

pub fn with_allow_drag(self, allow_drag: bool) -> Self

Source

pub fn with_user_data(self, user_data: Rc<dyn Any>) -> Self

Source

pub fn with_cursor(self, cursor: Option<CursorIcon>) -> Self

Source

pub fn with_opacity(self, opacity: Option<f32>) -> Self

Source

pub fn with_tooltip(self, tooltip: Handle<UiNode>) -> Self

Sets the desired tooltip for the node.

§Important

The widget will own the tooltip, which means that when widget will be deleted, the tooltip will be deleted too.

Source

pub fn with_tooltip_time(self, tooltip_time: f32) -> Self

Source

pub fn with_context_menu(self, context_menu: Handle<UiNode>) -> Self

The context menu receives PopupMessages for being displayed, and so should support those.

Source

pub fn build(self) -> Widget

Trait Implementations§

Source§

impl Default for WidgetBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V