Struct ButtonWidget

Source
pub struct ButtonWidget<A> { /* private fields */ }
Expand description

Public retained widget type produced internally by Button::into_view.

Fields are private; consumers normally construct Button instead.

§Examples

use ailloli_ui_widgets::controls::button::ButtonWidget;
let widget: Option<ButtonWidget<()>> = None;
assert!(widget.is_none());

Trait Implementations§

Source§

impl<A: 'static> Widget<A> for ButtonWidget<A>

Source§

fn debug_name(&self) -> &'static str

Returns a stable, non-sensitive static name for diagnostics. Read more
Source§

fn layout( &self, engine: &mut LayoutEngine<'_, A>, ctx: &mut LayoutCtx<'_>, children: &mut [LayoutChild], constraints: Constraints, ) -> LayoutResult

Measures and positions this widget’s direct retained children. Read more
Source§

fn paint( &self, ctx: &mut PaintCtx<'_>, bounds: Rect, _layout_result: &LayoutResult, )

Emits base draw commands for absolute logical-pixel bounds. Read more
Source§

fn paint_overlay( &self, ctx: &mut PaintCtx<'_>, bounds: Rect, _layout_result: &LayoutResult, )

Emits top-level paint commands after this widget’s descendants. Read more
Source§

fn event( &self, ctx: &mut EventCtx<A>, event: &Event, bounds: Rect, _layout: &LayoutResult, )

Handles one routed event for absolute bounds and cached layout. Read more
Source§

fn focus_policy(&self) -> FocusPolicy

Returns whether the widget may receive keyboard focus. Read more
Source§

fn activation_policy(&self) -> ActivationPolicy

Policy used for provider-neutral focus-only pointer gestures. Read more
§

fn layout_dependency_revision(&self) -> u64

Revision of widget-owned inputs that can change its layout result. Read more
§

fn layout_committed( &self, _ctx: &mut LayoutContext<'_>, _bounds: Rect, _layout: &LayoutResult, )

Observes newly committed absolute bounds after layout. Read more
§

fn input_role(&self) -> InputRole

Returns provider-neutral text-input semantics. Read more
§

fn hover_cursor_role(&self) -> HoverCursorRole

Returns the widget-wide hover cursor role. Read more
§

fn hover_cursor_role_at( &self, _bounds: Rect, _layout: &LayoutResult, _pos: Point, ) -> HoverCursorRole

Returns the hover cursor role at an absolute logical-pixel position. Read more
§

fn ime_cursor_rect(&self, _bounds: Rect, _layout: &LayoutResult) -> Option<Rect>

Returns the absolute logical-pixel IME candidate/caret rectangle. Read more

Auto Trait Implementations§

§

impl<A> Freeze for ButtonWidget<A>

§

impl<A> !RefUnwindSafe for ButtonWidget<A>

§

impl<A> !Send for ButtonWidget<A>

§

impl<A> !Sync for ButtonWidget<A>

§

impl<A> Unpin for ButtonWidget<A>

§

impl<A> !UnwindSafe for ButtonWidget<A>

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

impl<T> ErasedDestructor for T
where T: 'static,