pub struct ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,{ /* private fields */ }Expand description
A band that resizes along one axis when it is dragged, carrying a T that
the drag renders as an E. See resize_handle.
Implementations§
Source§impl<T, E> ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Sourcepub fn with_appearance(
self,
appearance: Rc<dyn Fn(&ResizeHandleContext, &mut Window, &mut App) -> Option<AnyElement>>,
) -> ResizeHandle<T, E>
pub fn with_appearance( self, appearance: Rc<dyn Fn(&ResizeHandleContext, &mut Window, &mut App) -> Option<AnyElement>>, ) -> ResizeHandle<T, E>
Hand the painted part of this handle to appearance.
Sourcepub fn on_drag(
self,
value: T,
f: impl Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E> + 'static,
) -> ResizeHandle<T, E>
pub fn on_drag( self, value: T, f: impl Fn(&T, &Point<Pixels>, &mut Window, &mut App) -> Entity<E> + 'static, ) -> ResizeHandle<T, E>
Start a drag carrying value when the band is pressed and moved.
A band takes one drag, and this is it: use this rather than
StatefulInteractiveElement::on_drag, which it shadows.
GPUI tells drags apart by the type of their payload, so the drag
carries value itself, and a caller following it with
on_drag_move listens for a T.
Sourcepub fn inside(self, edge: HandleEdge) -> ResizeHandle<T, E>
pub fn inside(self, edge: HandleEdge) -> ResizeHandle<T, E>
Keep the whole handle inside its container, hugging edge, instead of
straddling the boundary it resizes.
Trait Implementations§
Source§impl<T, E> Element for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> Element for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Source§type PrepaintState = Hitbox
type PrepaintState = Hitbox
The band’s own hitbox, so the listeners in paint can ask whether the
pointer is really on the handle rather than merely within its bounds.
Source§type RequestLayoutState = AnyElement
type RequestLayoutState = AnyElement
The type of state returned from
Element::request_layout. A mutable reference to this state is subsequently
provided to Element::prepaint and Element::paint.Source§fn id(&self) -> Option<ElementId>
fn id(&self) -> Option<ElementId>
If this element has a unique identifier, return it here. This is used to track elements across frames, and
will cause a GlobalElementId to be passed to the request_layout, prepaint, and paint methods. Read more
Source§fn source_location(&self) -> Option<&'static Location<'static>>
fn source_location(&self) -> Option<&'static Location<'static>>
Source location where this element was constructed, used to disambiguate elements in the
inspector and navigate to their source code.
Source§fn request_layout(
&mut self,
id: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
window: &mut Window,
cx: &mut App,
) -> (LayoutId, <ResizeHandle<T, E> as Element>::RequestLayoutState)
fn request_layout( &mut self, id: Option<&GlobalElementId>, _: Option<&InspectorElementId>, window: &mut Window, cx: &mut App, ) -> (LayoutId, <ResizeHandle<T, E> as Element>::RequestLayoutState)
Before an element can be painted, we need to know where it’s going to be and how big it is.
Use this method to request a layout from Taffy and initialize the element’s state.
Source§fn prepaint(
&mut self,
_: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
bounds: Bounds<Pixels>,
request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState,
window: &mut Window,
cx: &mut App,
) -> <ResizeHandle<T, E> as Element>::PrepaintState
fn prepaint( &mut self, _: Option<&GlobalElementId>, _: Option<&InspectorElementId>, bounds: Bounds<Pixels>, request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState, window: &mut Window, cx: &mut App, ) -> <ResizeHandle<T, E> as Element>::PrepaintState
After laying out an element, we need to commit its bounds to the current frame for hitbox
purposes. The state argument is the same state that was returned from
Element::request_layout().Source§fn paint(
&mut self,
id: Option<&GlobalElementId>,
_: Option<&InspectorElementId>,
_: Bounds<Pixels>,
request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState,
hitbox: &mut <ResizeHandle<T, E> as Element>::PrepaintState,
window: &mut Window,
cx: &mut App,
)
fn paint( &mut self, id: Option<&GlobalElementId>, _: Option<&InspectorElementId>, _: Bounds<Pixels>, request_layout: &mut <ResizeHandle<T, E> as Element>::RequestLayoutState, hitbox: &mut <ResizeHandle<T, E> as Element>::PrepaintState, window: &mut Window, cx: &mut App, )
Once layout has been completed, this method will be called to paint the element to the screen.
The state argument is the same state that was returned from
Element::request_layout().Source§fn a11y_role(&self) -> Option<Role>
fn a11y_role(&self) -> Option<Role>
Returns the accessible role for this element, if any.
Elements that return
None are not included in the accessibility tree. Read moreSource§fn write_a11y_info(&self, _node: &mut Node)
fn write_a11y_info(&self, _node: &mut Node)
Write accessibility properties to the given node.
Called only when
a11y_role() returns Some. Read moreSource§fn a11y_synthetic_children(
&mut self,
_prepaint: &mut Self::PrepaintState,
_builder: &mut A11ySubtreeBuilder<'_>,
)
fn a11y_synthetic_children( &mut self, _prepaint: &mut Self::PrepaintState, _builder: &mut A11ySubtreeBuilder<'_>, )
Source§fn into_any(self) -> AnyElement
fn into_any(self) -> AnyElement
Convert this element into a dynamically-typed
AnyElement.Source§impl<T, E> InteractiveElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> InteractiveElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Source§fn interactivity(&mut self) -> &mut Interactivity
fn interactivity(&mut self) -> &mut Interactivity
Retrieve the interactivity state associated with this element
Source§fn group(self, group: impl Into<SharedString>) -> Self
fn group(self, group: impl Into<SharedString>) -> Self
Assign this element to a group of elements that can be styled together
Source§fn id(self, id: impl Into<ElementId>) -> Stateful<Self>
fn id(self, id: impl Into<ElementId>) -> Stateful<Self>
Assign this element an ID, so that it can be used with interactivity
Source§fn track_focus(self, focus_handle: &FocusHandle) -> Self
fn track_focus(self, focus_handle: &FocusHandle) -> Self
Track the focus state of the given focus handle on this element.
If the focus handle is focused by the application, this element will
apply its focused styles.
Source§fn tab_index(self, index: isize) -> Self
fn tab_index(self, index: isize) -> Self
Set index of the tab stop order, and set this node as a tab stop.
This will default the element to being a tab stop. See
Self::tab_stop for more information.
This should only be used in conjunction with tab_group
in order to not interfere with the tab index of other elements.Source§fn tab_group(self) -> Self
fn tab_group(self) -> Self
Designate this div as a “tab group”. Tab groups have their own location in the tab-index order,
but for children of the tab group, the tab index is reset to 0. This can be useful for swapping
the order of tab stops within the group, without having to renumber all the tab stops in the whole
application.
Source§fn key_context<C, E>(self, key_context: C) -> Self
fn key_context<C, E>(self, key_context: C) -> Self
Set the keymap context for this element. This will be used to determine
which action to dispatch from the keymap.
Source§fn hover(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
fn hover(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
Apply the given style to this element when the mouse hovers over it
Source§fn group_hover(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Self
fn group_hover( self, group_name: impl Into<SharedString>, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self
Apply the given style to this element when the mouse hovers over a group member
Source§fn on_mouse_down(
self,
button: MouseButton,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_down( self, button: MouseButton, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for the given mouse button.
The fluent API equivalent to
Interactivity::on_mouse_down. Read moreSource§fn debug_selector(self, _: impl FnOnce() -> String) -> Self
fn debug_selector(self, _: impl FnOnce() -> String) -> Self
Set a key that can be used to look up this element’s bounds
in the [
crate::VisualTestContext::debug_bounds] map. Read moreSource§fn capture_any_mouse_down(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::capture_any_mouse_down. Read moreSource§fn on_any_mouse_down(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::on_any_mouse_down. Read moreSource§fn on_mouse_up(
self,
button: MouseButton,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_up( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event for the given button, during the bubble phase.
The fluent API equivalent to
Interactivity::on_mouse_up. Read moreSource§fn capture_any_mouse_up(
self,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_any_mouse_up( self, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::capture_any_mouse_up. Read moreSource§fn on_mouse_pressure(
self,
listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse pressure event, during the bubble phase
the fluent API equivalent to
Interactivity::on_mouse_pressure Read moreSource§fn capture_mouse_pressure(
self,
listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse pressure event, during the capture phase
the fluent API equivalent to
Interactivity::on_mouse_pressure Read moreSource§fn on_mouse_down_out(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_down_out( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event, on any button, during the capture phase,
when the mouse is outside of the bounds of this element.
The fluent API equivalent to
Interactivity::on_mouse_down_out. Read moreSource§fn on_mouse_up_out(
self,
button: MouseButton,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_up_out( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event, for the given button, during the capture phase,
when the mouse is outside of the bounds of this element.
The fluent API equivalent to
Interactivity::on_mouse_up_out. Read moreSource§fn on_mouse_move(
self,
listener: impl Fn(&MouseMoveEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_move( self, listener: impl Fn(&MouseMoveEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse move event, during the bubble phase.
The fluent API equivalent to
Interactivity::on_mouse_move. Read moreSource§fn on_mouse_exit(
self,
listener: impl Fn(&MouseExitEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_exit( self, listener: impl Fn(&MouseExitEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse exit event, during the bubble phase.
The fluent API equivalent to
Interactivity::on_mouse_exit. Read moreSource§fn on_file_drop_exit(
self,
listener: impl Fn(&FileDropEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_file_drop_exit( self, listener: impl Fn(&FileDropEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to
FileDropEvent::Exited when a platform file drag
leaves this element’s window while the element is hovered. Read moreSource§fn on_drag_move<T>(
self,
listener: impl Fn(&DragMoveEvent<T>, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
fn on_drag_move<T>(
self,
listener: impl Fn(&DragMoveEvent<T>, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
Bind the given callback to the mouse drag event of the given type. Note that this
will be called for all move events, inside or outside of this element, as long as the
drag was started with this element under the mouse. Useful for implementing draggable
UIs that don’t conform to a drag and drop style interaction, like resizing.
The fluent API equivalent to
Interactivity::on_drag_move. Read moreSource§fn on_scroll_wheel(
self,
listener: impl Fn(&ScrollWheelEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_scroll_wheel( self, listener: impl Fn(&ScrollWheelEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to scroll wheel events during the bubble phase.
The fluent API equivalent to
Interactivity::on_scroll_wheel. Read moreSource§fn on_pinch(
self,
listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to pinch gesture events during the bubble phase.
The fluent API equivalent to
Interactivity::on_pinch. Read moreSource§fn capture_pinch(
self,
listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to pinch gesture events during the capture phase.
The fluent API equivalent to
Interactivity::capture_pinch. Read moreSource§fn capture_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
fn capture_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
Capture the given action, before normal action dispatch can fire.
The fluent API equivalent to
Interactivity::capture_action. Read moreSource§fn on_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
fn on_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
Bind the given callback to an action dispatch during the bubble phase.
The fluent API equivalent to
Interactivity::on_action. Read moreSource§fn on_boxed_action(
self,
action: &(dyn Action + 'static),
listener: impl Fn(&(dyn Action + 'static), &mut Window, &mut App) + 'static,
) -> Self
fn on_boxed_action( self, action: &(dyn Action + 'static), listener: impl Fn(&(dyn Action + 'static), &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to an action dispatch, based on a dynamic action parameter
instead of a type parameter. Useful for component libraries that want to expose
action bindings to their users.
The fluent API equivalent to
Interactivity::on_boxed_action. Read moreSource§fn on_key_down(
self,
listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key down events during the bubble phase.
The fluent API equivalent to
Interactivity::on_key_down. Read moreSource§fn capture_key_down(
self,
listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key down events during the capture phase.
The fluent API equivalent to
Interactivity::capture_key_down. Read moreSource§fn on_key_up(
self,
listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key up events during the bubble phase.
The fluent API equivalent to
Interactivity::on_key_up. Read moreSource§fn capture_key_up(
self,
listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key up events during the capture phase.
The fluent API equivalent to
Interactivity::capture_key_up. Read moreSource§fn on_modifiers_changed(
self,
listener: impl Fn(&ModifiersChangedEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_modifiers_changed( self, listener: impl Fn(&ModifiersChangedEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to modifiers changing events.
The fluent API equivalent to
Interactivity::on_modifiers_changed. Read moreSource§fn drag_over<S>(
self,
f: impl Fn(StyleRefinement, &S, &mut Window, &mut App) -> StyleRefinement + 'static,
) -> Selfwhere
S: 'static,
fn drag_over<S>(
self,
f: impl Fn(StyleRefinement, &S, &mut Window, &mut App) -> StyleRefinement + 'static,
) -> Selfwhere
S: 'static,
Apply the given style when the given data type is dragged over this element
Source§fn group_drag_over<S>(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
S: 'static,
fn group_drag_over<S>(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
S: 'static,
Apply the given style when the given data type is dragged over this element’s group
Source§fn on_drop<T>(
self,
listener: impl Fn(&T, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
fn on_drop<T>(
self,
listener: impl Fn(&T, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
Bind the given callback to drop events of the given type, whether or not the drag started on this element.
The fluent API equivalent to
Interactivity::on_drop. Read moreSource§fn can_drop(
self,
predicate: impl Fn(&(dyn Any + 'static), &mut Window, &mut App) -> bool + 'static,
) -> Self
fn can_drop( self, predicate: impl Fn(&(dyn Any + 'static), &mut Window, &mut App) -> bool + 'static, ) -> Self
Use the given predicate to determine whether or not a drop event should be dispatched to this element.
The fluent API equivalent to
Interactivity::can_drop.Source§fn occlude(self) -> Self
fn occlude(self) -> Self
Block the mouse from all interactions with elements behind this element’s hitbox. Typically
block_mouse_except_scroll should be preferred.
The fluent API equivalent to Interactivity::occlude_mouse.Source§fn window_control_area(self, area: WindowControlArea) -> Self
fn window_control_area(self, area: WindowControlArea) -> Self
Set the bounds of this element as a window control area for the platform window.
The fluent API equivalent to
Interactivity::window_control_area.Source§fn block_mouse_except_scroll(self) -> Self
fn block_mouse_except_scroll(self) -> Self
Block non-scroll mouse interactions with elements behind this element’s hitbox.
The fluent API equivalent to
Interactivity::block_mouse_except_scroll. Read moreSource§fn focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element, specifically, is focused.
Requires that the element is focusable. Elements can be made focusable using
InteractiveElement::track_focus.Source§fn in_focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn in_focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is inside another element that is focused.
Requires that the element is focusable. Elements can be made focusable using
InteractiveElement::track_focus.Source§fn focus_visible(
self,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
fn focus_visible(
self,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is focused via keyboard navigation.
This is similar to CSS’s
:focus-visible pseudo-class - it only applies when the element
is focused AND the user is navigating via keyboard (not mouse clicks).
Requires that the element is focusable. Elements can be made focusable using InteractiveElement::track_focus.Source§impl<T, E> InteractiveElementExt for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> InteractiveElementExt for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Source§fn lock_scroll_axis(self) -> Selfwhere
Self: Sized + StatefulInteractiveElement,
fn lock_scroll_axis(self) -> Selfwhere
Self: Sized + StatefulInteractiveElement,
Locks scrolling to the gesture’s dominant axis, where the platform
supports it. See
OngoingScrollExt for why this is a no-op on wasm32.Source§fn on_double_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_double_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Set the listener for a double click event.
Source§impl<T, E> IntoElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> IntoElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Source§type Element = ResizeHandle<T, E>
type Element = ResizeHandle<T, E>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> <ResizeHandle<T, E> as IntoElement>::Element
fn into_element(self) -> <ResizeHandle<T, E> as IntoElement>::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl<T, E> StatefulInteractiveElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
impl<T, E> StatefulInteractiveElement for ResizeHandle<T, E>where
T: 'static,
E: 'static + Render,
Source§fn accessibility_id(self, id: impl Into<SharedString>) -> Self
fn accessibility_id(self, id: impl Into<SharedString>) -> Self
Set the author-provided identifier exposed to accessibility clients. Read more
Source§fn aria_label(self, label: impl Into<SharedString>) -> Self
fn aria_label(self, label: impl Into<SharedString>) -> Self
Set the accessible label for this element.
Source§fn aria_description(self, description: impl Into<SharedString>) -> Self
fn aria_description(self, description: impl Into<SharedString>) -> Self
Set the accessible description for this element. Unlike the label (which
names the element), the description provides supplementary information
that assistive technology announces after the name, role, and value -
for example a settings subtitle or a hint.
Source§fn aria_keyshortcuts(self, keyshortcuts: impl Into<SharedString>) -> Self
fn aria_keyshortcuts(self, keyshortcuts: impl Into<SharedString>) -> Self
Set the keyboard shortcut(s) that activate this element, announced by
assistive technology (maps to AccessKit’s
keyboard_shortcut). Read moreSource§fn aria_active_descendant(self) -> Self
fn aria_active_descendant(self) -> Self
Report this element as the focused node in the accessibility tree,
overriding the element that holds real keyboard focus — but only while
one of its ancestors actually holds focus. Read more
Source§fn a11y_synthetic_children(
self,
f: impl FnOnce(&mut A11ySubtreeBuilder<'_>) + 'static,
) -> Self
fn a11y_synthetic_children( self, f: impl FnOnce(&mut A11ySubtreeBuilder<'_>) + 'static, ) -> Self
Contribute synthetic accessibility nodes — nodes that don’t correspond
to any element — as children of this element’s a11y node. For example,
text runs describing an editor’s text content. Read more
Source§fn aria_selected(self, selected: bool) -> Self
fn aria_selected(self, selected: bool) -> Self
Set the selected state for this element.
Source§fn aria_expanded(self, expanded: bool) -> Self
fn aria_expanded(self, expanded: bool) -> Self
Set the expanded state for this element.
Source§fn aria_toggled(self, toggled: Toggled) -> Self
fn aria_toggled(self, toggled: Toggled) -> Self
Set the toggled state for this element.
Source§fn aria_numeric_value(self, value: f64) -> Self
fn aria_numeric_value(self, value: f64) -> Self
Set the numeric value for this element.
Source§fn aria_numeric_value_step(self, step: f64) -> Self
fn aria_numeric_value_step(self, step: f64) -> Self
Set the step by which assistive technology should expect the numeric
value of this element to change (e.g. when incrementing a spin button).
Source§fn aria_value(self, value: impl Into<SharedString>) -> Self
fn aria_value(self, value: impl Into<SharedString>) -> Self
Set the string value of this element, e.g. the text content of a simple
text input.
Source§fn aria_placeholder(self, placeholder: impl Into<SharedString>) -> Self
fn aria_placeholder(self, placeholder: impl Into<SharedString>) -> Self
Set the placeholder text reported to assistive technology for this
element, shown when a text input is empty.
Source§fn aria_min_numeric_value(self, value: f64) -> Self
fn aria_min_numeric_value(self, value: f64) -> Self
Set the minimum numeric value for this element.
Source§fn aria_max_numeric_value(self, value: f64) -> Self
fn aria_max_numeric_value(self, value: f64) -> Self
Set the maximum numeric value for this element.
Source§fn aria_orientation(self, orientation: Orientation) -> Self
fn aria_orientation(self, orientation: Orientation) -> Self
Set the orientation of this element.
Source§fn aria_level(self, level: usize) -> Self
fn aria_level(self, level: usize) -> Self
Set the heading level of this element.
Source§fn aria_position_in_set(self, position: usize) -> Self
fn aria_position_in_set(self, position: usize) -> Self
Set the position in set of this element.
Source§fn aria_size_of_set(self, size: usize) -> Self
fn aria_size_of_set(self, size: usize) -> Self
Set the size of set for this element.
Source§fn aria_row_index(self, index: usize) -> Self
fn aria_row_index(self, index: usize) -> Self
Set the row index for this element.
Source§fn aria_column_index(self, index: usize) -> Self
fn aria_column_index(self, index: usize) -> Self
Set the column index for this element.
Source§fn aria_row_count(self, count: usize) -> Self
fn aria_row_count(self, count: usize) -> Self
Set the row count for this element.
Source§fn aria_column_count(self, count: usize) -> Self
fn aria_column_count(self, count: usize) -> Self
Set the column count for this element.
Source§fn on_a11y_action(
self,
action: Action,
listener: impl FnMut(Option<&ActionData>, &mut Window, &mut App) + 'static,
) -> Self
fn on_a11y_action( self, action: Action, listener: impl FnMut(Option<&ActionData>, &mut Window, &mut App) + 'static, ) -> Self
Register a handler for an accessibility action on this element.
The handler is called when a screen reader requests the given action. Read more
Source§fn overflow_scroll(self) -> Self
fn overflow_scroll(self) -> Self
Set the overflow x and y to scroll.
Source§fn overflow_x_scroll(self) -> Self
fn overflow_x_scroll(self) -> Self
Set the overflow x to scroll.
Source§fn overflow_y_scroll(self) -> Self
fn overflow_y_scroll(self) -> Self
Set the overflow y to scroll.
Source§fn restrict_scroll_to_axis(self) -> Self
fn restrict_scroll_to_axis(self) -> Self
Restrict scrolling of this element to the axis of the input gesture. Read more
Source§fn track_scroll(self, scroll_handle: &ScrollHandle) -> Self
fn track_scroll(self, scroll_handle: &ScrollHandle) -> Self
Track the scroll state of this element with the given handle.
Source§fn anchor_scroll(self, scroll_anchor: Option<ScrollAnchor>) -> Self
fn anchor_scroll(self, scroll_anchor: Option<ScrollAnchor>) -> Self
Track the scroll state of this element with the given handle.
Source§fn active(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn active(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is active.
Source§fn group_active(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
fn group_active(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element’s group is active.
Source§fn on_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback to click events of this element.
The fluent API equivalent to
Interactivity::on_click. Read moreSource§fn on_aux_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_aux_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback to non-primary click events of this element.
The fluent API equivalent to
Interactivity::on_aux_click. Read moreSource§fn on_drag<T, W>(
self,
value: T,
constructor: impl Fn(&T, Point<Pixels>, &mut Window, &mut App) -> Entity<W> + 'static,
) -> Self
fn on_drag<T, W>( self, value: T, constructor: impl Fn(&T, Point<Pixels>, &mut Window, &mut App) -> Entity<W> + 'static, ) -> Self
On drag initiation, this callback will be used to create a new view to render the dragged value for a
drag and drop operation. This API should also be used as the equivalent of ‘on drag start’ with
the
InteractiveElement::on_drag_move API.
The callback also has access to the offset of triggering click from the origin of parent element.
The fluent API equivalent to Interactivity::on_drag. Read moreSource§fn external_drag_payload<T>(
self,
resolver: impl Fn(&T, &mut Window, &mut App) -> Option<ExternalDragPayload> + 'static,
) -> Selfwhere
Self: Sized,
T: 'static,
fn external_drag_payload<T>(
self,
resolver: impl Fn(&T, &mut Window, &mut App) -> Option<ExternalDragPayload> + 'static,
) -> Selfwhere
Self: Sized,
T: 'static,
Registers a callback resolving a payload to offer the platform if a drag started by this
element leaves the window. It is invoked at most once per drag gesture, when the pointer
exits the viewport. Must be called after
Self::on_drag, with the same dragged value
type T.
The fluent API equivalent to Interactivity::external_drag_payload.Source§fn on_hover(
self,
listener: impl Fn(&bool, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_hover(
self,
listener: impl Fn(&bool, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback on the hover start and end events of this element. Note that the boolean
passed to the callback is true when the hover starts and false when it ends.
Transitions caused by layout changes under a stationary mouse also invoke the callback. Read more
Source§fn hover_listener_mode(self, mode: HoverListenerMode) -> Selfwhere
Self: Sized,
fn hover_listener_mode(self, mode: HoverListenerMode) -> Selfwhere
Self: Sized,
Sets how
Self::on_hover responds to key presses while the mouse is stationary.
This affects only the hover listener, not hover styles or tooltips. The fluent API
equivalent to Interactivity::hover_listener_mode.Source§fn tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
fn tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
Constructs a tooltip when the element is hovered or long-pressed.
The fluent API equivalent to
Interactivity::tooltip.Source§fn hoverable_tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
fn hoverable_tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
Constructs a tooltip when the element is hovered or long-pressed.
The tooltip itself is also hoverable and won’t disappear when the user moves the mouse into
the tooltip. The fluent API equivalent to
Interactivity::hoverable_tooltip.Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for ResizeHandle<T, E>
impl<T, E> !Send for ResizeHandle<T, E>
impl<T, E> !Sync for ResizeHandle<T, E>
impl<T, E> !UnwindSafe for ResizeHandle<T, E>
impl<T, E> Freeze for ResizeHandle<T, E>
impl<T, E> Unpin for ResizeHandle<T, E>
impl<T, E> UnsafeUnpin for ResizeHandle<T, E>
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with a chain of animations
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
Renders this component or element at the value produced by a spring. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§impl<T> FocusTrapElement for Twhere
T: InteractiveElement,
impl<T> FocusTrapElement for Twhere
T: InteractiveElement,
Source§fn focus_trap(
self,
id: impl Into<ElementId>,
focus_handle: &FocusHandle,
) -> FocusTrapContainer<Self>
fn focus_trap( self, id: impl Into<ElementId>, focus_handle: &FocusHandle, ) -> FocusTrapContainer<Self>
Enable focus trap for this element. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more