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: f32Explicit width for node or automatic if NaN (means value is undefined). Default is NaN
height: f32Explicit 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: usizeIndex of row to which this node belongs
column: usizeIndex of column to which this node belongs
vertical_alignment: VerticalAlignmentVertical alignment
horizontal_alignment: HorizontalAlignmentHorizontal alignment
margin: ThicknessMargin (four sides)
visibility: boolCurrent 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§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§
source§impl Widget
impl Widget
pub fn handle(&self) -> Handle<UiNode>
pub fn name(&self) -> &str
pub fn set_name<P: AsRef<str>>(&mut self, name: P) -> &mut Self
pub fn actual_local_size(&self) -> Vector2<f32>
sourcepub fn actual_initial_size(&self) -> Vector2<f32>
pub fn actual_initial_size(&self) -> Vector2<f32>
Returns size of the widget without any layout or rendering transform applied.
pub fn actual_global_size(&self) -> Vector2<f32>
pub fn set_min_size(&mut self, value: Vector2<f32>) -> &mut Self
pub fn set_min_width(&mut self, value: f32) -> &mut Self
pub fn set_min_height(&mut self, value: f32) -> &mut Self
pub fn min_size(&self) -> Vector2<f32>
pub fn min_width(&self) -> f32
pub fn min_height(&self) -> f32
pub fn is_drag_allowed(&self) -> bool
pub fn is_drop_allowed(&self) -> bool
pub fn screen_to_local(&self, point: Vector2<f32>) -> Vector2<f32>
pub fn invalidate_layout(&self)
pub fn invalidate_measure(&self)
pub fn invalidate_arrange(&self)
pub fn is_hit_test_visible(&self) -> bool
pub fn set_max_size(&mut self, value: Vector2<f32>) -> &mut Self
pub fn max_size(&self) -> Vector2<f32>
pub fn max_width(&self) -> f32
pub fn max_height(&self) -> f32
pub fn set_z_index(&mut self, z_index: usize) -> &mut Self
pub fn z_index(&self) -> usize
pub fn set_background(&mut self, brush: Brush) -> &mut Self
pub fn background(&self) -> Brush
pub fn set_foreground(&mut self, brush: Brush) -> &mut Self
pub fn foreground(&self) -> Brush
pub fn set_width(&mut self, width: f32) -> &mut Self
pub fn width(&self) -> f32
pub fn is_draw_on_top(&self) -> bool
pub fn set_height(&mut self, height: f32) -> &mut Self
pub fn height(&self) -> f32
pub fn set_desired_local_position(&mut self, pos: Vector2<f32>) -> &mut Self
pub fn screen_position(&self) -> Vector2<f32>
pub fn children(&self) -> &[Handle<UiNode>]
pub fn parent(&self) -> Handle<UiNode>
pub fn set_parent(&mut self, parent: Handle<UiNode>)
pub fn column(&self) -> usize
pub fn set_row(&mut self, row: usize) -> &mut Self
pub fn row(&self) -> usize
pub fn desired_size(&self) -> Vector2<f32>
pub fn desired_local_position(&self) -> Vector2<f32>
pub fn screen_bounds(&self) -> Rect<f32>
pub fn bounding_rect(&self) -> Rect<f32>
pub fn visual_transform(&self) -> &Matrix3<f32>
pub fn render_transform(&self) -> &Matrix3<f32>
pub fn layout_transform(&self) -> &Matrix3<f32>
pub fn has_descendant(
&self,
node_handle: Handle<UiNode>,
ui: &UserInterface
) -> bool
sourcepub fn find_by_criteria_up<Func: Fn(&UiNode) -> bool>(
&self,
ui: &UserInterface,
func: Func
) -> Handle<UiNode>
pub fn find_by_criteria_up<Func: Fn(&UiNode) -> bool>(
&self,
ui: &UserInterface,
func: Func
) -> Handle<UiNode>
Searches a node up on tree starting from given root that matches a criteria defined by a given func.
pub fn handle_routed_message(
&mut self,
_ui: &mut UserInterface,
msg: &mut UiMessage
)
pub fn set_vertical_alignment(
&mut self,
vertical_alignment: VerticalAlignment
) -> &mut Self
pub fn vertical_alignment(&self) -> VerticalAlignment
pub fn set_horizontal_alignment(
&mut self,
horizontal_alignment: HorizontalAlignment
) -> &mut Self
pub fn horizontal_alignment(&self) -> HorizontalAlignment
pub fn set_column(&mut self, column: usize) -> &mut Self
pub fn set_margin(&mut self, margin: Thickness) -> &mut Self
pub fn margin(&self) -> Thickness
pub fn measure_override(
&self,
ui: &UserInterface,
available_size: Vector2<f32>
) -> Vector2<f32>
pub fn arrange_override(
&self,
ui: &UserInterface,
final_size: Vector2<f32>
) -> Vector2<f32>
pub fn is_arrange_valid(&self) -> bool
pub fn is_measure_valid(&self) -> bool
pub fn actual_local_position(&self) -> Vector2<f32>
pub fn center(&self) -> Vector2<f32>
pub fn is_globally_visible(&self) -> bool
pub fn set_visibility(&mut self, visibility: bool) -> &mut Self
pub fn request_update_visibility(&self)
pub fn visibility(&self) -> bool
pub fn set_enabled(&mut self, enabled: bool) -> &mut Self
pub fn enabled(&self) -> bool
pub fn set_cursor(&mut self, cursor: Option<CursorIcon>)
pub fn cursor(&self) -> Option<CursorIcon>
pub fn user_data_ref<T: 'static>(&self) -> Option<&T>
pub fn clip_bounds(&self) -> Rect<f32>
pub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Self
pub fn opacity(&self) -> Option<f32>
pub fn tooltip(&self) -> Rc<Handle<UiNode>>
pub fn set_tooltip(&mut self, tooltip: Rc<Handle<UiNode>>) -> &mut Self
pub fn tooltip_time(&self) -> f32
pub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Self
The context menu receives PopupMessages for being displayed, and so should support those.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Widget
impl !Send for Widget
impl !Sync for Widget
impl Unpin for Widget
impl !UnwindSafe for Widget
Blanket Implementations§
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.