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
§preview_messages: bool
§handle_os_events: bool
Implementations§
Source§impl WidgetBuilder
impl WidgetBuilder
pub fn new() -> Self
pub fn with_preview_messages(self, state: bool) -> Self
pub fn with_handle_os_events(self, state: bool) -> Self
pub fn with_width(self, width: f32) -> Self
pub fn with_height(self, height: f32) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
pub fn with_vertical_alignment(self, valign: VerticalAlignment) -> Self
pub fn with_horizontal_alignment(self, halign: HorizontalAlignment) -> Self
pub fn with_max_size(self, max_size: Vector2<f32>) -> Self
pub fn with_min_size(self, min_size: Vector2<f32>) -> Self
pub fn with_background(self, brush: Brush) -> Self
pub fn with_foreground(self, brush: Brush) -> Self
pub fn on_row(self, row: usize) -> Self
pub fn on_column(self, column: usize) -> Self
pub fn with_margin(self, margin: Thickness) -> Self
pub fn with_desired_position(self, desired_position: Vector2<f32>) -> Self
pub fn with_z_index(self, z_index: usize) -> Self
pub fn with_child(self, handle: Handle<UiNode>) -> Self
pub fn with_draw_on_top(self, draw_on_top: bool) -> Self
pub fn with_children<I: IntoIterator<Item = Handle<UiNode>>>( self, children: I, ) -> Self
pub fn with_name(self, name: &str) -> Self
pub fn with_hit_test_visibility(self, state: bool) -> Self
pub fn with_visibility(self, visibility: bool) -> Self
pub fn with_allow_drop(self, allow_drop: bool) -> Self
pub fn with_allow_drag(self, allow_drag: bool) -> Self
pub fn with_user_data(self, user_data: Rc<dyn Any>) -> Self
pub fn with_cursor(self, cursor: Option<CursorIcon>) -> Self
pub fn with_opacity(self, opacity: Option<f32>) -> Self
Sourcepub fn with_tooltip(self, tooltip: Handle<UiNode>) -> Self
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.
pub fn with_tooltip_time(self, tooltip_time: f32) -> Self
The context menu receives PopupMessage
s for being displayed, and so should support those.
pub fn build(self) -> Widget
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WidgetBuilder
impl !RefUnwindSafe for WidgetBuilder
impl !Send for WidgetBuilder
impl !Sync for WidgetBuilder
impl Unpin for WidgetBuilder
impl !UnwindSafe for WidgetBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.