Struct vizia_core::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) -> Self

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

source

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

Mody the internal data of the view.

source

pub fn on_build<F>(self, callback: F) -> Self
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) -> Self
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: Into<AvatarVariant>>(self, variant: impl Res<U>) -> Self

Selects the style variant for the Avatar.

source

pub fn badge<F>(self, content: F) -> Self
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) -> Self

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>) -> Self

source§

impl Handle<'_, Checkbox>

source

pub fn on_toggle<F>(self, callback: F) -> Self
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 'static + Fn(&mut EventContext<'_>) + Send + Sync, ) -> Self

source

pub fn variant<U: Into<ChipVariant>>(self, variant: impl Res<U>) -> Self

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) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize),

source§

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

source

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

source§

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

source

pub fn orientation(self, orientation: impl Res<Orientation>) -> Self

source§

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

source

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

source§

impl Handle<'_, ArcTrack>

source

pub fn value<L: Lens<Target = f32>>(self, lens: L) -> Self

source§

impl Handle<'_, TickKnob>

source

pub fn value<L: Lens<Target = f32>>(self, lens: L) -> Self

source§

impl Handle<'_, Label>

source

pub fn describing(self, entity_identifier: impl Into<String>) -> Self

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) -> Self
where F: 'static + Fn(&mut EventContext<'_>, usize),

source§

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

source

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

source§

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

source

pub fn placement(self, placement: impl Res<Placement>) -> Self

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) -> Self

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

source

pub fn arrow_size(self, size: impl Into<Length>) -> Self

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

source

pub fn should_reposition(self, flag: bool) -> Self

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

source

pub fn on_blur<F>(self, f: F) -> Self
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>) -> Self

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) -> Self
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) -> Self
where F: 'static + Fn(&mut EventContext<'_>, u32),

source§

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

source

pub fn scroll_to_cursor(self, scroll_to_cursor: impl Res<bool>) -> Self

source§

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

source

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

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) -> Self

source

pub fn scrollx(self, scrollx: impl Res<f32>) -> Self

source

pub fn scrolly(self, scrollx: impl Res<f32>) -> Self

source§

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

source

pub fn on_changing<F>(self, callback: F) -> Self
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>) -> Self

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) -> Self

source

pub fn keyboard_fraction(self, keyboard_fraction: f32) -> Self

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) -> Self
where F: 'static + Fn(&mut EventContext<'_>, f32),

source

pub fn range(self, range: Range<f32>) -> Self

source

pub fn keyboard_fraction(self, keyboard_fraction: f32) -> Self

source§

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

source

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

source

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

source

pub fn orientation(self, orientation: impl Res<Orientation>) -> Self

source

pub fn icons(self, icons: impl Res<SpinboxIcons>) -> Self

source§

impl Handle<'_, Switch>

source

pub fn on_toggle<F>(self, callback: F) -> Self
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) -> Self

source

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

source

pub fn with_selected<U: Into<usize>>(self, selected: impl Res<U>) -> Self

source§

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

source

pub fn on_edit<F>(self, callback: F) -> Self
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) -> Self
where F: 'static + Fn(&mut EventContext<'_>, L::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) -> Self
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) -> Self
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) -> Self
where F: 'static + Fn(&L::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: ToStringLocalized>(self, text: impl Res<P>) -> Self

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) -> Self

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) -> Self

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

source

pub fn arrow_size(self, size: impl Into<Length>) -> Self

source§

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

source

pub fn scroll_to_cursor(self, flag: bool) -> Self

source§

impl Handle<'_, XYPad>

source

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

Trait Implementations§

source§

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

source§

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

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

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

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

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

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

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

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

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

source§

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

Sets the accessibility role of the view.
source§

fn name<U: ToStringLocalized>(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: Into<bool>>(self, hidden: impl Res<U>) -> Self

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

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

Sets the accessibility numeric value for the view.
source§

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

Sets the accessibility text value for the view.
source§

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

source§

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

source§

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

source§

fn on_press<F>(self, action: F) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
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) -> Self
where F: 'static + Fn(&mut EventContext<'_>) + Send + Sync,

source§

fn on_drop<F>(self, action: F) -> Self
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: Into<ButtonVariant>>(self, variant: impl Res<U>) -> Self

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: Into<ButtonVariant>>(self, variant: impl Res<U>) -> Self

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: 'static>(&self) -> Option<&T>

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: View> LayoutModifiers for Handle<'a, V>

source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sets the width of the view.
source§

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

Sets the height of the view.
source§

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

Sets the width and height of the view.
source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sets the minimum width of the view.
source§

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

Sets the minimum height of the view.
source§

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

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

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

Sets the maximum width of the view.
source§

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

Sets the maximum height of the view.
source§

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

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

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

Sets the minimum left space of the view.
source§

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

Sets the minimum right space of the view.
source§

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

Sets the minimum top space of the view.
source§

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

Sets the minimum bottom space of the view.
source§

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

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

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

Sets the maximum left space of the view.
source§

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

Sets the maximum right space of the view.
source§

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

Sets the maximum top space of the view.
source§

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

Sets the maximum bottom space of the view.
source§

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

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

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

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: Into<bool>>(self, state: impl Res<U>) -> Self

Sets the checked state of the view.
source§

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

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

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

source§

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

source§

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

Sets the view to be disabled. Read more
source§

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

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

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

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

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

Sets the opacity of the view. Read more
source§

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

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

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

Sets the clip path for the the view.
source§

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

source§

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

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

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

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

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

Sets the backdrop filter for the view.
source§

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

Add a shadow to the view.
source§

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

source§

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

source§

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

Sets the background color of the view.
source§

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

source§

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

Sets the border width of the view.
source§

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

Sets the border color of the view.
source§

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

Sets the border color of the view.
source§

fn corner_top_left_radius<U: Into<LengthOrPercentage>>( 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: Into<LengthOrPercentage>>( 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: Into<LengthOrPercentage>>( 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: Into<LengthOrPercentage>>( self, value: impl Res<U>, ) -> Self

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sets the outline width of the view.
source§

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

Sets the outline color of the view.
source§

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

Sets the outline offset of the view.
source§

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

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

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

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

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

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

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

Sets the transform origin of the the view.
source§

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

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

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

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

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

Sets the scale of the view. Read more
source§

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

source§

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

Sets the text content of the view.
source§

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

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

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

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

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

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

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

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

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

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

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

Sets the text color of the view.
source§

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

Sets the font size of the view.
source§

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

Sets the ext caret color of the view.
source§

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

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

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

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

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

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

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

Sets the text overflow.
source§

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

Sets the max number of .
source§

fn text_decoration_line<U: Into<TextDecorationLine>>( 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) -> Self

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

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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