Struct vizia::view::Handle

source ·
pub struct Handle<'a, V> { /* private fields */ }
Expand description

A handle to a view which has been built into the tree.

Implementations§

source§

impl<'a, V> Handle<'a, V>

source

pub fn entity(&self) -> Entity

Returns the [Entity] id of the view.

source

pub fn context(&mut self) -> &mut Context

Returns a mutable reference to the context.

source

pub fn parent(&self) -> Entity

source

pub fn lock_focus_to_within(self) -> Handle<'a, V>

Stop the user from tabbing out of a subtree, which is useful for modal dialogs.

source

pub fn modify<F>(self, f: F) -> Handle<'a, V>
where F: FnOnce(&mut V), V: 'static,

Mody the internal data of the view.

source

pub fn on_build<F>(self, callback: F) -> Handle<'a, V>
where F: Fn(&mut EventContext<'_>),

Callback which is run when the view is built/rebuilt.

source

pub fn bind<R, T, F>(self, res: R, closure: F) -> Handle<'a, V>
where R: Res<T>, F: 'static + Clone + Fn(Handle<'_, V>, R),

source

pub fn needs_relayout(&mut self)

Marks the view as needing a relayout.

source

pub fn needs_restyle(&mut self)

Marks the view as needing a restyle.

source

pub fn needs_redraw(&mut self)

Marks the view as needing a redraw.

source

pub fn bounds(&self) -> BoundingBox

Returns the bounding box of the view.

source

pub fn scale_factor(&self) -> f32

Returns the scale factor of the device.

source§

impl<'a> Handle<'a, Avatar>

source

pub fn variant<U>(self, variant: impl Res<U>) -> Handle<'a, Avatar>
where U: Into<AvatarVariant>,

Selects the style variant for the Avatar.

source

pub fn badge<F>(self, content: F) -> Handle<'a, Avatar>
where F: FnOnce(&mut Context) -> Handle<'_, Badge>,

Adds a badge to the Avatar.

source§

impl<'a> Handle<'a, Badge>

source

pub fn placement(self, placement: BadgePlacement) -> Handle<'a, Badge>

Sets the placement of a badge relative to its parent when used with the badge modifier.

source§

impl<'a> Handle<'a, ButtonGroup>

source

pub fn vertical(self, is_vertical: impl Res<bool>) -> Handle<'a, ButtonGroup>

source§

impl Handle<'_, Checkbox>

source

pub fn on_toggle<F>(self, callback: F) -> Handle<'_, Checkbox>
where F: 'static + Fn(&mut EventContext<'_>),

Set the callback triggered when the checkbox is pressed.

§Examples
Checkbox::new(cx, AppData::value).on_toggle(|cx| cx.emit(AppEvent::ToggleValue));
source§

impl<'a> Handle<'a, Chip>

source

pub fn on_close( self, callback: impl Fn(&mut EventContext<'_>) + Send + Sync + 'static, ) -> Handle<'a, Chip>

source

pub fn variant<U>(self, variant: impl Res<U>) -> Handle<'a, Chip>
where U: Into<ChipVariant>,

Selects the style variant to be used by the chip.

§Example
Chip::new(cx, "Chip")
    .variant(ChipVariant::Filled);
source§

impl<'v, L1, L2, T> Handle<'v, ComboBox<L1, L2, T>>
where L1: Lens<Target = Vec<T>>, T: 'static + Data + ToString, L2: Lens<Target = usize>,

source

pub fn on_select<F>(self, callback: F) -> Handle<'v, ComboBox<L1, L2, T>>
where F: 'static + Fn(&mut EventContext<'_>, usize),

source§

impl<'a> Handle<'a, Datepicker>

source

pub fn on_select<F>(self, callback: F) -> Handle<'a, Datepicker>
where F: 'static + Fn(&mut EventContext<'_>, NaiveDate),

source§

impl<'a> Handle<'a, Divider>

source

pub fn orientation( self, orientation: impl Res<Orientation>, ) -> Handle<'a, Divider>

source§

impl<'a, L> Handle<'a, Knob<L>>
where L: Lens<Target = f32>,

source

pub fn on_changing<F>(self, callback: F) -> Handle<'a, Knob<L>>
where F: 'static + Fn(&mut EventContext<'_>, f32),

source§

impl Handle<'_, ArcTrack>

source

pub fn value<L>(self, lens: L) -> Handle<'_, ArcTrack>
where L: Lens<Target = f32>,

source§

impl Handle<'_, TickKnob>

source

pub fn value<L>(self, lens: L) -> Handle<'_, TickKnob>
where L: Lens<Target = f32>,

source§

impl Handle<'_, Label>

source

pub fn describing( self, entity_identifier: impl Into<String>, ) -> Handle<'_, Label>

Which form element does this label describe.

§Examples
Checkbox::new(cx, AppData::value).on_toggle(|cx| cx.emit(AppEvent::ToggleValue)).id("checkbox_identifier");
Label::new(cx, "hello").describing("checkbox_identifier");
source§

impl<'v> Handle<'v, PickList>

source

pub fn on_select<F>(self, callback: F) -> Handle<'v, PickList>
where F: 'static + Fn(&mut EventContext<'_>, usize),

source§

impl<'v> Handle<'v, ScrollList>

source

pub fn on_select<F>(self, callback: F) -> Handle<'v, ScrollList>
where F: 'static + Fn(&mut EventContext<'_>, usize),

source§

impl<'a> Handle<'a, Popup>

source

pub fn placement(self, placement: impl Res<Placement>) -> Handle<'a, Popup>

Sets the position where the tooltip should appear relative to its parent element. Defaults to Placement::Bottom.

source

pub fn arrow(self, show_arrow: bool) -> Handle<'a, Popup>

Sets whether the popup should include an arrow. Defaults to true.

source

pub fn arrow_size(self, size: impl Into<Length>) -> Handle<'a, Popup>

Sets the size of the popup arrow, or gap if the arrow is hidden.

source

pub fn should_reposition(self, flag: bool) -> Handle<'a, Popup>

Set to whether the popup should reposition to always be visible.

source

pub fn on_blur<F>(self, f: F) -> Handle<'a, Popup>
where F: 'static + Fn(&mut EventContext<'_>),

Registers a callback for when the user clicks off of the popup, usually with the intent of closing it.

source§

impl<'a> Handle<'a, ProgressBar>

source

pub fn bar_color(self, color: impl Res<Color>) -> Handle<'a, ProgressBar>

Set the color of the bar inside the ProgressBar.

you also pass a lens to this method if you want to be able to change the color dynamically.

source§

impl Handle<'_, RadioButton>

source

pub fn on_select<F>(self, callback: F) -> Handle<'_, RadioButton>
where F: 'static + Fn(&mut EventContext<'_>),

Set the callback triggered when the radio button is selected.

§Examples
RadioButton::new(cx, AppData::value).on_select(|cx| cx.emit(AppEvent::ToggleValue));
source§

impl<'a> Handle<'a, Rating>

source

pub fn on_change<F>(self, callback: F) -> Handle<'a, Rating>
where F: 'static + Fn(&mut EventContext<'_>, u32),

source§

impl<'a, L1> Handle<'a, Scrollbar<L1>>
where L1: 'static + Lens<Target = f32>,

source

pub fn scroll_to_cursor( self, scroll_to_cursor: impl Res<bool>, ) -> Handle<'a, Scrollbar<L1>>

source§

impl<'a> Handle<'a, ScrollView>

source

pub fn on_scroll( self, callback: impl Fn(&mut EventContext<'_>, f32, f32) + Send + Sync + 'static, ) -> Handle<'a, ScrollView>

Sets a callback which will be called when a scrollview is scrolled, either with the mouse wheel, touchpad, or using the scroll bars.

source

pub fn scroll_to_cursor(self, scroll_to_cursor: bool) -> Handle<'a, ScrollView>

source

pub fn scrollx(self, scrollx: impl Res<f32>) -> Handle<'a, ScrollView>

source

pub fn scrolly(self, scrollx: impl Res<f32>) -> Handle<'a, ScrollView>

source§

impl<L> Handle<'_, Slider<L>>
where L: Lens,

source

pub fn on_changing<F>(self, callback: F) -> Handle<'_, Slider<L>>
where F: 'static + Fn(&mut EventContext<'_>, f32),

Sets the callback triggered when the slider value is changing (dragging).

Takes a closure which triggers when the slider value is changing, either by pressing the track or dragging the thumb along the track.

§Example
Slider::new(cx, AppData::value)
    .on_changing(|cx, value| {
        debug!("Slider on_changing: {}", value);
    });
source

pub fn range(self, range: Range<f32>) -> Handle<'_, Slider<L>>

Sets the range of the slider.

If the bound data is outside of the range then the slider will clip to min/max of the range.

§Example
Slider::new(cx, AppData::value)
    .range(-20.0..50.0)
    .on_changing(|cx, value| {
        debug!("Slider on_changing: {}", value);
    });
source

pub fn step(self, step: f32) -> Handle<'_, Slider<L>>

source

pub fn keyboard_fraction(self, keyboard_fraction: f32) -> Handle<'_, Slider<L>>

Sets the fraction of a slider that a press of an arrow key will change.

§Example
Slider::new(cx, AppData::value)
    .keyboard_fraction(0.05)
    .on_changing(|cx, value| {
        debug!("Slider on_changing: {}", value);
    });
source§

impl Handle<'_, NamedSlider>

source

pub fn on_changing<F>(self, callback: F) -> Handle<'_, NamedSlider>
where F: 'static + Fn(&mut EventContext<'_>, f32),

source

pub fn range(self, range: Range<f32>) -> Handle<'_, NamedSlider>

source

pub fn keyboard_fraction( self, keyboard_fraction: f32, ) -> Handle<'_, NamedSlider>

source§

impl<'a> Handle<'a, Spinbox>

source

pub fn on_increment<F>(self, callback: F) -> Handle<'a, Spinbox>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

source

pub fn on_decrement<F>(self, callback: F) -> Handle<'a, Spinbox>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

source

pub fn orientation( self, orientation: impl Res<Orientation>, ) -> Handle<'a, Spinbox>

source

pub fn icons(self, icons: impl Res<SpinboxIcons>) -> Handle<'a, Spinbox>

source§

impl Handle<'_, Switch>

source

pub fn on_toggle<F>(self, callback: F) -> Handle<'_, Switch>
where F: 'static + Fn(&mut EventContext<'_>),

Set the callback triggered when the Switch is pressed.

§Examples
Switch::new(cx, AppData::value).on_toggle(|cx| cx.emit(AppEvent::ToggleValue));
source§

impl<'a> Handle<'a, TabView>

source

pub fn vertical(self) -> Handle<'a, TabView>

source

pub fn on_select( self, callback: impl Fn(&mut EventContext<'_>, usize) + 'static, ) -> Handle<'a, TabView>

source

pub fn with_selected<U>(self, selected: impl Res<U>) -> Handle<'a, TabView>
where U: Into<usize>,

source§

impl<'a, L> Handle<'a, Textbox<L>>
where L: Lens,

source

pub fn on_edit<F>(self, callback: F) -> Handle<'a, Textbox<L>>
where F: 'static + Fn(&mut EventContext<'_>, String) + Send + Sync,

Sets the callback triggered when a textbox is edited, i.e. text is inserted/deleted.

Callback provides the current text of the textbox.

source

pub fn on_submit<F>(self, callback: F) -> Handle<'a, Textbox<L>>
where F: 'static + Fn(&mut EventContext<'_>, <L as Lens>::Target, bool) + Send + Sync,

Sets the callback triggered when a textbox is submitted, i.e. when the enter key is pressed with a single-line textbox or the textbox loses focus.

Callback provides the text of the textbox and a flag to indicate if the submit was due to a key press or a loss of focus.

source

pub fn on_blur<F>(self, callback: F) -> Handle<'a, Textbox<L>>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Sets the callback triggered when a textbox is blurred, i.e. the mouse is pressed outside of the textbox.

source

pub fn on_cancel<F>(self, callback: F) -> Handle<'a, Textbox<L>>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Sets the callback triggered when a textbox edit is cancelled, i.e. the escape key is pressed while editing.

source

pub fn validate<F>(self, is_valid: F) -> Handle<'a, Textbox<L>>
where F: 'static + Fn(&<L as Lens>::Target) -> bool + Send + Sync,

Sets a validation closure which is called when the textbox is edited and sets the validity attribute to the output of the closure.

If a textbox is modified with the validate modifier then the on_submit will not be called if the text is invalid.

source

pub fn placeholder<P>(self, text: impl Res<P>) -> Handle<'a, Textbox<L>>

Sets the placeholder text that appears when the textbox has no value.

source§

impl<'a> Handle<'a, Tooltip>

source

pub fn placement(self, placement: Placement) -> Handle<'a, Tooltip>

Sets the position where the tooltip should appear relative to its parent element. Defaults to Placement::Bottom.

source

pub fn arrow(self, show_arrow: bool) -> Handle<'a, Tooltip>

Sets whether the tooltip should include an arrow. Defaults to true.

source

pub fn arrow_size(self, size: impl Into<Length>) -> Handle<'a, Tooltip>

source§

impl<'a> Handle<'a, VirtualList>

source

pub fn scroll_to_cursor(self, flag: bool) -> Handle<'a, VirtualList>

source§

impl Handle<'_, XYPad>

source

pub fn on_change<F>(self, callback: F) -> Handle<'_, XYPad>
where F: Fn(&mut EventContext<'_>, f32, f32) + 'static,

Trait Implementations§

source§

impl<'a, V> AbilityModifiers for Handle<'a, V>

source§

fn hoverable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be hovered by the mouse and receive mouse events. Read more
source§

fn focusable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be focused to receive keyboard input events. Read more
source§

fn checkable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be checked. Read more
source§

fn navigable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be navigated to, i.e. focused, by the keyboard. Read more
source§

impl<'a, V> AccessibilityModifiers for Handle<'a, V>
where V: View,

source§

fn role(self, role: Role) -> Self

Sets the accessibility role of the view.
source§

fn name<U>(self, name: impl Res<U>) -> Self

Sets the accessibility name of the view.
source§

fn default_action_verb(self, action_verb: DefaultActionVerb) -> Self

Sets the accessibility default action for the view.
source§

fn live(self, live: Live) -> Self

Sets whether the view should act as an accessibility live region.
source§

fn hidden<U>(self, hidden: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view should be hidden from accessibility.
source§

fn numeric_value<U>(self, value: impl Res<U>) -> Self
where U: Into<f64>,

Sets the accessibility numeric value for the view.
source§

fn text_value<U>(self, value: impl Res<U>) -> Self

Sets the accessibility text value for the view.
source§

impl<'a, V> ActionModifiers<V> for Handle<'a, V>
where V: View,

source§

fn tooltip<C>(self, content: C) -> Handle<'a, V>
where C: Fn(&mut Context) -> Handle<'_, Tooltip> + 'static,

source§

fn menu<C, T>(self, content: C) -> Handle<'a, V>
where C: FnOnce(&mut Context) -> Handle<'_, T>, T: View,

source§

fn on_press<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the the view receives the Press event. By default a view receives the Press event when the left mouse button is pressed and then released on the view, or when the space or enter keys are pressed and then released while the view is focused. Read more
source§

fn on_press_down<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the the view receives the PressDown event. or when the space or enter keys are pressed while the view is focused. Read more
source§

fn on_double_click<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, MouseButton) + Send + Sync,

Adds a callback which is performed when the the view receives the MouseDoubleClick event. Read more
source§

fn on_hover<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the mouse pointer moves over a view. This callback is not triggered when the mouse pointer moves over an overlapping child of the view. Read more
source§

fn on_hover_out<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the mouse pointer moves away from a view. This callback is not triggered when the mouse pointer moves away from an overlapping child of the view. Read more
source§

fn on_over<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the mouse pointer moves over the bounds of a view, including any overlapping children. Read more
source§

fn on_over_out<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the mouse pointer moves away from the bounds of a view, including any overlapping children. Read more
source§

fn on_mouse_move<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, f32, f32) + Send + Sync,

Adds a callback which is performed when the mouse pointer moves within the bounds of a view. Read more
source§

fn on_mouse_down<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, MouseButton) + Send + Sync,

Adds a callback which is performed when a mouse button is pressed on the view. Unlike the on_press callback, this callback is triggered for all mouse buttons and not for any keyboard keys. Read more
source§

fn on_mouse_up<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, MouseButton) + Send + Sync,

Adds a callback which is performed when a mouse button is released on the view. Unlike the on_release callback, this callback is triggered for all mouse buttons and not for any keyboard keys. Read more
source§

fn on_focus_in<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the view gains keyboard focus. Read more
source§

fn on_focus_out<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

Adds a callback which is performed when the view loses keyboard focus. Read more
source§

fn on_geo_changed<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, GeoChanged) + Send + Sync,

Adds a callback which is performed when the the view changes size or position after layout. Read more
source§

fn on_drag<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

source§

fn on_drop<F>(self, action: F) -> Handle<'a, V>
where F: 'static + Fn(&mut EventContext<'_>, DropData) + Send + Sync,

source§

impl<'a, V> AsMut<Context> for Handle<'a, V>

source§

fn as_mut(&mut self) -> &mut Context

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<'a> ButtonModifiers for Handle<'a, Button>

source§

fn variant<U>(self, variant: impl Res<U>) -> Handle<'a, Button>
where U: Into<ButtonVariant>,

Selects the style variant to be used by the button or button group. Read more
source§

impl<'a> ButtonModifiers for Handle<'a, ButtonGroup>

source§

fn variant<U>(self, variant: impl Res<U>) -> Handle<'a, ButtonGroup>
where U: Into<ButtonVariant>,

Selects the style variant to be used by the button or button group. Read more
source§

impl<'a, V> DataContext for Handle<'a, V>

source§

fn data<T>(&self) -> Option<&T>
where T: 'static,

Get model/view data from the context. Returns None if the data does not exist.
source§

fn as_context(&self) -> Option<LocalizationContext<'_>>

source§

impl<'a, V> LayoutModifiers for Handle<'a, V>
where V: View,

source§

fn layout_type<U>(self, value: impl Res<U>) -> Self
where U: Into<LayoutType>,

Sets the layout type of the view. Read more
source§

fn position_type<U>(self, value: impl Res<U>) -> Self
where U: Into<PositionType>,

Sets the position type of the view. Read more
source§

fn left<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space on the left side of the view. Read more
source§

fn right<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space on the right side of the view. Read more
source§

fn top<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space on the top side of the view. Read more
source§

fn bottom<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space on the bottom side of the view. Read more
source§

fn space<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space for all sides of the view.
source§

fn width<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the width of the view.
source§

fn height<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the height of the view.
source§

fn size<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the width and height of the view.
source§

fn child_left<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the left side of the view and the left side of its children. Read more
source§

fn child_right<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the right side of the view and the right side of its children. Read more
source§

fn child_top<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the top side of the view and the top side of its children. Read more
source§

fn child_bottom<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the bottom side of the view and the bottom side of its children. Read more
source§

fn child_space<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the vew and its children. Read more
source§

fn row_between<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the views children in a vertical stack.
source§

fn col_between<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the space between the views children in a horizontal stack.
source§

fn min_width<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum width of the view.
source§

fn min_height<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum height of the view.
source§

fn min_size<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum width and minimum height of the view.
source§

fn max_width<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum width of the view.
source§

fn max_height<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum height of the view.
source§

fn max_size<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum width and maximum height of the view.
source§

fn min_left<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum left space of the view.
source§

fn min_right<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum right space of the view.
source§

fn min_top<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum top space of the view.
source§

fn min_bottom<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum bottom space of the view.
source§

fn min_space<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the minimum space for all sides of the view.
source§

fn max_left<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum left space of the view.
source§

fn max_right<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum right space of the view.
source§

fn max_top<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum top space of the view.
source§

fn max_bottom<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum bottom space of the view.
source§

fn max_space<U>(self, value: impl Res<U>) -> Self
where U: Into<Units>,

Sets the maximum space for all sides of the view.
source§

impl<'a, V> StyleModifiers for Handle<'a, V>
where V: View,

source§

fn id(self, id: impl Into<String>) -> Self

Sets the ID name of the view. Read more
source§

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

Adds a class name to the view. Read more
source§

fn toggle_class(self, name: &str, applied: impl Res<bool>) -> Self

Sets whether a view should have the given class name.
source§

fn checked<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets the checked state of the view.
source§

fn focused<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets the focused state of the view. Read more
source§

fn read_only<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

source§

fn read_write<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

source§

fn disabled<U>(self, value: impl Res<U>) -> Self
where U: Into<bool>,

Sets the view to be disabled. Read more
source§

fn display<U>(self, value: impl Res<U>) -> Self
where U: Into<Display>,

Sets whether the view should be positioned and rendered. Read more
source§

fn visibility<U>(self, value: impl Res<U>) -> Self
where U: Into<Visibility>,

Sets whether the view should be rendered. Read more
source§

fn opacity<U>(self, value: impl Res<U>) -> Self
where U: Into<Opacity>,

Sets the opacity of the view. Read more
source§

fn z_index<U>(self, value: impl Res<U>) -> Self
where U: Into<i32>,

Sets the z-index of the view. Read more
source§

fn clip_path<U>(self, value: impl Res<U>) -> Self
where U: Into<ClipPath>,

Sets the clip path for the the view.
source§

fn overflow<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

source§

fn overflowx<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

Sets the overflow behavior of the view in the horizontal direction. Read more
source§

fn overflowy<U>(self, value: impl Res<U>) -> Self
where U: Into<Overflow>,

Sets the overflow behavior of the view in the vertical direction. Read more
source§

fn backdrop_filter<U>(self, value: impl Res<U>) -> Self
where U: Into<Filter>,

Sets the backdrop filter for the view.
source§

fn shadow<U>(self, value: impl Res<U>) -> Self
where U: Into<Shadow>,

Add a shadow to the view.
source§

fn shadows<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<Shadow>>,

source§

fn background_gradient<U>(self, value: impl Res<U>) -> Self
where U: Into<Gradient>,

source§

fn background_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the background color of the view.
source§

fn background_image<'i, U>(self, value: impl Res<U>) -> Self
where U: Into<BackgroundImage<'i>>,

source§

fn border_width<U>(self, value: impl Res<U>) -> Self

Sets the border width of the view.
source§

fn border_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the border color of the view.
source§

fn border_style<U>(self, value: impl Res<U>) -> Self

Sets the border color of the view.
source§

fn corner_top_left_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the top-left corner of the view.
source§

fn corner_top_right_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the top-right corner of the view.
source§

fn corner_bottom_left_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the bottom-left corner of the view.
source§

fn corner_bottom_right_radius<U>(self, value: impl Res<U>) -> Self

Sets the corner radius for the bottom-right corner of the view.
source§

fn corner_radius<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<CornerRadius>,

Sets the corner radius for all four corners of the view.
source§

fn corner_top_left_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the top-left corner of the view.
source§

fn corner_top_right_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the top-right corner of the view.
source§

fn corner_bottom_left_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the bottom-left corner of the view.
source§

fn corner_bottom_right_shape<U>(self, value: impl Res<U>) -> Self
where U: Into<CornerShape>,

Sets the corner corner shape for the bottom-right corner of the view.
source§

fn corner_shape<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<Rect<CornerShape>>,

Sets the corner shape for all four corners of the view.
source§

fn corner_top_left_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the top-left corner of the view.
source§

fn corner_top_right_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the top-right corner of the view.
source§

fn corner_bottom_left_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the bottom-left corner of the view.
source§

fn corner_bottom_right_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Into<f32>,

Sets the corner smoothing for the bottom-right corner of the view.
source§

fn corner_smoothing<U>(self, value: impl Res<U>) -> Self
where U: Debug + Into<Rect<f32>>,

Sets the corner smoothing for all four corners of the view.
source§

fn outline_width<U>(self, value: impl Res<U>) -> Self

Sets the outline width of the view.
source§

fn outline_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the outline color of the view.
source§

fn outline_offset<U>(self, value: impl Res<U>) -> Self

Sets the outline offset of the view.
source§

fn cursor<U>(self, value: impl Res<U>) -> Self
where U: Into<CursorIcon>,

Sets the mouse cursor used when the view is hovered.
source§

fn pointer_events<U>(self, value: impl Res<U>) -> Self
where U: Into<PointerEvents>,

Sets whether the view can be become the target of pointer events.
source§

fn transform<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<Transform>>,

Sets the transform of the view with a list of transform functions.
source§

fn transform_origin<U>(self, value: impl Res<U>) -> Self
where U: Into<Position>,

Sets the transform origin of the the view.
source§

fn translate<U>(self, value: impl Res<U>) -> Self
where U: Into<Translate>,

Sets the translation offset of the view. Read more
source§

fn rotate<U>(self, value: impl Res<U>) -> Self
where U: Into<Angle>,

Sets the angle of rotation for the view. Read more
source§

fn scale<U>(self, value: impl Res<U>) -> Self
where U: Into<Scale>,

Sets the scale of the view. Read more
source§

impl<'a, V> TextModifiers for Handle<'a, V>

source§

fn text<T>(self, value: impl Res<T>) -> Self

Sets the text content of the view.
source§

fn font_family<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<FamilyOwned>>,

Sets the font that should be used by the view. Read more
source§

fn font_weight<U>(self, value: impl Res<U>) -> Self
where U: Into<FontWeight>,

Sets the font weight that should be used by the view.
source§

fn font_slant<U>(self, value: impl Res<U>) -> Self
where U: Into<FontSlant>,

Sets the font style that should be used by the view.
source§

fn font_width<U>(self, value: impl Res<U>) -> Self
where U: Into<FontWidth>,

Sets the font stretch that should be used by the view if the font supports it.
source§

fn font_variation_settings<U>(self, value: impl Res<U>) -> Self
where U: Into<Vec<FontVariation>>,

Sets the font variation settings that should be used by the view.
source§

fn color<U>(self, value: impl Res<U>) -> Self
where U: Clone + Into<Color>,

Sets the text color of the view.
source§

fn font_size<U>(self, value: impl Res<U>) -> Self
where U: Into<FontSize>,

Sets the font size of the view.
source§

fn caret_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the ext caret color of the view.
source§

fn selection_color<U>(self, value: impl Res<U>) -> Self
where U: Into<Color>,

Sets the color used to highlight selected text within the view.
source§

fn text_wrap<U>(self, value: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the text of the view should be allowed to wrap.
source§

fn text_align<U>(self, value: impl Res<U>) -> Self
where U: Into<TextAlign>,

Sets the horizontal alignment of text within the view.
source§

fn text_overflow<U>(self, value: impl Res<U>) -> Self
where U: Into<TextOverflow>,

Sets the text overflow.
source§

fn line_clamp<U>(self, value: impl Res<U>) -> Self
where U: Into<LineClamp>,

Sets the max number of .
source§

fn text_decoration_line<U>(self, value: impl Res<U>) -> Self

Sets the max number of .
source§

impl<'a> ToggleButtonModifiers for Handle<'a, ToggleButton>

source§

fn on_toggle( self, callback: impl Fn(&mut EventContext<'_>) + 'static, ) -> Handle<'a, ToggleButton>

source§

impl<'a> WindowModifiers for Handle<'a, Window>

source§

fn on_close( self, callback: impl Fn(&mut EventContext<'_>) + 'static, ) -> Handle<'a, Window>

source§

fn on_create( self, callback: impl Fn(&mut EventContext<'_>) + 'static, ) -> Handle<'a, Window>

source§

fn title<T>(self, title: impl Res<T>) -> Handle<'a, Window>
where T: ToString,

Sets the title of the window to the given value. Accepts a type, or lens to a type, which implements ToString. Read more
source§

fn inner_size<S>(self, size: impl Res<S>) -> Handle<'a, Window>
where S: Into<WindowSize>,

Sets the inner size of the window to the given value. Accepts a value, or lens, which can be converted to a [WindowSize]. Read more
source§

fn min_inner_size<S>(self, size: impl Res<Option<S>>) -> Handle<'a, Window>
where S: Into<WindowSize>,

Sets the minimum inner size of the window to the given value. Accepts an optional value, or lens, which can be converted to a [WindowSize]. Read more
source§

fn max_inner_size<S>(self, size: impl Res<Option<S>>) -> Handle<'a, Window>
where S: Into<WindowSize>,

Sets the maximum inner size of the window to the given value. Accepts an optional value, or lens, which can be converted to a [WindowSize]. Read more
source§

fn position<P>(self, position: impl Res<P>) -> Handle<'a, Window>
where P: Into<WindowPosition>,

Sets the position of the window to the given value. Accepts a value, or lens, which can be converted to a [Position]. Read more
source§

fn resizable(self, flag: impl Res<bool>) -> Handle<'a, Window>

Sets whether the window can be resized. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn minimized(self, flag: impl Res<bool>) -> Handle<'a, Window>

Sets whether the window is minimized. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn maximized(self, flag: impl Res<bool>) -> Handle<'a, Window>

Sets whether the window is maximized. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn visible(self, flag: bool) -> Handle<'a, Window>

Sets whether the window is visible. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn transparent(self, flag: bool) -> Handle<'a, Window>

Sets whether the window is transparent. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn decorations(self, flag: bool) -> Handle<'a, Window>

Sets whether the window has decorations. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn always_on_top(self, flag: bool) -> Handle<'a, Window>

Sets whether the window should be on top of other windows. Accepts a boolean value, or lens to a boolean value. Read more
source§

fn vsync(self, flag: bool) -> Handle<'a, Window>

Sets whether the window has vsync enabled. Read more
source§

fn icon(self, width: u32, height: u32, image: Vec<u8>) -> Handle<'a, Window>

Sets the icon used for the window. Read more
source§

fn enabled_window_buttons( self, window_buttons: WindowButtons, ) -> Handle<'a, Window>

Auto Trait Implementations§

§

impl<'a, V> Freeze for Handle<'a, V>

§

impl<'a, V> !RefUnwindSafe for Handle<'a, V>

§

impl<'a, V> !Send for Handle<'a, V>

§

impl<'a, V> !Sync for Handle<'a, V>

§

impl<'a, V> Unpin for Handle<'a, V>
where V: Unpin,

§

impl<'a, V> !UnwindSafe for Handle<'a, V>

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
§

impl<T> Downcast for T
where T: Any,

§

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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

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

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

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

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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> Same for T

source§

type Output = T

Should always be Self
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