Struct fyrox_ui::widget::Widget

source ·
pub struct Widget {
Show 48 fields pub handle: Handle<UiNode>, pub name: String, pub desired_local_position: Vector2<f32>, pub width: f32, pub height: f32, pub min_size: Vector2<f32>, pub max_size: Vector2<f32>, pub background: Brush, pub foreground: Brush, pub row: usize, pub column: usize, pub vertical_alignment: VerticalAlignment, pub horizontal_alignment: HorizontalAlignment, pub margin: Thickness, pub visibility: bool, pub global_visibility: bool, pub children: Vec<Handle<UiNode>>, pub parent: Handle<UiNode>, pub command_indices: RefCell<Vec<usize>>, pub is_mouse_directly_over: bool, pub hit_test_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: Rc<Handle<UiNode>>, pub tooltip_time: f32, pub context_menu: Handle<UiNode>, pub clip_to_bounds: bool, pub layout_transform: Matrix3<f32>, pub render_transform: Matrix3<f32>, pub visual_transform: Matrix3<f32>, pub preview_messages: bool, pub handle_os_events: bool, pub layout_events_sender: Option<Sender<LayoutEvent>>, pub measure_valid: Cell<bool>, pub arrange_valid: Cell<bool>, pub prev_measure: Cell<Vector2<f32>>, pub prev_arrange: Cell<Rect<f32>>, pub desired_size: Cell<Vector2<f32>>, pub actual_local_position: Cell<Vector2<f32>>, pub actual_local_size: Cell<Vector2<f32>>, pub prev_global_visibility: bool, pub clip_bounds: Cell<Rect<f32>>,
}

Fields§

§handle: Handle<UiNode>§name: String§desired_local_position: Vector2<f32>

Desired position relative to parent node

§width: f32

Explicit width for node or automatic if NaN (means value is undefined). Default is NaN

§height: f32

Explicit height for node or automatic if NaN (means value is undefined). Default is NaN

§min_size: Vector2<f32>

Minimum width and height

§max_size: Vector2<f32>

Maximum width and height

§background: Brush§foreground: Brush§row: usize

Index of row to which this node belongs

§column: usize

Index of column to which this node belongs

§vertical_alignment: VerticalAlignment

Vertical alignment

§horizontal_alignment: HorizontalAlignment

Horizontal alignment

§margin: Thickness

Margin (four sides)

§visibility: bool

Current visibility state

§global_visibility: bool§children: Vec<Handle<UiNode>>§parent: Handle<UiNode>§command_indices: RefCell<Vec<usize>>

Indices of commands in command buffer emitted by the node.

§is_mouse_directly_over: bool§hit_test_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: Rc<Handle<UiNode>>§tooltip_time: f32§context_menu: Handle<UiNode>§clip_to_bounds: bool§layout_transform: Matrix3<f32>§render_transform: Matrix3<f32>§visual_transform: Matrix3<f32>§preview_messages: bool§handle_os_events: bool§layout_events_sender: Option<Sender<LayoutEvent>>§measure_valid: Cell<bool>

Layout. Interior mutability is a must here because layout performed in a series of recursive calls.

§arrange_valid: Cell<bool>§prev_measure: Cell<Vector2<f32>>§prev_arrange: Cell<Rect<f32>>§desired_size: Cell<Vector2<f32>>

Desired size of the node after Measure pass.

§actual_local_position: Cell<Vector2<f32>>

Actual local position of the widget after Arrange pass.

§actual_local_size: Cell<Vector2<f32>>

Actual local size of the widget after Arrange pass.

§prev_global_visibility: bool§clip_bounds: Cell<Rect<f32>>

Implementations§

Returns size of the widget without any layout or rendering transform applied.

Searches a node up on tree starting from given root that matches a criteria defined by a given func.

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

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Casts self to a &dyn Any

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.