Skip to main content

UiElement

Struct UiElement 

Source
pub struct UiElement { /* private fields */ }

Implementations§

Source§

impl UiElement

Source

pub fn new(id: UiId, kind: UiNodeKind, rect: UiRect) -> Self

Source

pub fn group(id: UiId, rect: UiRect) -> Self

Source

pub fn panel(id: UiId, rect: UiRect, style: VisualStyle) -> Self

Source

pub fn button(id: UiId, rect: UiRect, style: VisualStyle) -> Self

Source

pub fn text( id: UiId, rect: UiRect, text: impl Into<Cow<'static, str>>, style: TextStyle, ) -> Self

Source

pub fn custom(id: UiId, rect: UiRect, key: &'static str) -> Self

Source

pub fn custom_paint( id: UiId, rect: UiRect, key: &'static str, style: CustomPaintStyle, ) -> Self

Source

pub fn image( id: UiId, rect: UiRect, source: &'static str, fit: ImageFit, ) -> Self

Source

pub fn file_image( id: UiId, rect: UiRect, source: impl Into<PathBuf>, fit: ImageFit, ) -> Self

Source

pub fn requested_image( id: UiId, rect: UiRect, request: impl Into<ImageRequest>, fit: ImageFit, ) -> Self

Source

pub fn icon(id: UiId, rect: UiRect, key: &'static str) -> Self

Source

pub fn glow(id: UiId, rect: UiRect, color: Color, alpha: u8) -> Self

Source

pub fn backdrop_blur(id: UiId, rect: UiRect, style: BackdropBlurStyle) -> Self

Source

pub fn backdrop_blur_path( id: UiId, rect: UiRect, path: UiPath, style: BackdropBlurStyle, ) -> Self

Source

pub fn overlay(id: UiId, rect: UiRect, style: OverlayStyle) -> Self

Source

pub fn static_layer(id: UiId, rect: UiRect, spec: StaticLayerSpec) -> Self

Source

pub fn compositing_layer( id: UiId, rect: UiRect, spec: CompositingLayerSpec, ) -> Self

Source

pub fn scroll_raster(id: UiId, viewport: UiRect, spec: ScrollRasterSpec) -> Self

Source

pub fn clip(id: UiId, rect: UiRect, offset_x: f32, offset_y: f32) -> Self

Source

pub fn clip_path(id: UiId, rect: UiRect, path: UiPath) -> Self

Source

pub fn line(id: UiId, rect: UiRect, style: VisualStyle) -> Self

Source

pub fn path(id: UiId, rect: UiRect, path: UiPath, style: PathStyle) -> Self

Source

pub fn ellipse(id: UiId, rect: UiRect, style: VisualStyle) -> Self

Source

pub fn node(&self) -> &UiNode

Source

pub fn children_ref(&self) -> &[UiElement]

Source

pub fn child(self, child: UiElement) -> Self

Source

pub fn children(self, children: impl IntoIterator<Item = UiElement>) -> Self

Source

pub fn interaction(self, interaction: InteractionRole) -> Self

Source

pub fn semantics(self, semantics: Semantics) -> Self

Source

pub fn window_drag_region(self) -> Self

Marks this element as a native window drag region.

Interactive descendants remain clickable and automatically take precedence over the drag region during platform hit testing.

Source

pub fn on_click<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_click_handler(self, handler: UiEventHandler) -> Self

Source

pub fn on_click_async<F, Fut>(self, handler: F) -> Self
where F: Fn(UiAsyncContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source

pub fn on_click_capture<F>(self, handler: F) -> Self
where F: Fn(&mut UiEventContext) + Send + Sync + 'static,

Source

pub fn on_event_handler( self, kind: UiEventKind, capture: bool, handler: UiInputEventHandler, ) -> Self

Source

pub fn on_event<F>(self, kind: UiEventKind, handler: F) -> Self
where F: Fn(&mut UiEventContext, &UiEventPayload) + Send + Sync + 'static,

Source

pub fn on_event_capture<F>(self, kind: UiEventKind, handler: F) -> Self
where F: Fn(&mut UiEventContext, &UiEventPayload) + Send + Sync + 'static,

Source

pub fn on_click_capture_handler(self, handler: UiEventHandler) -> Self

Source

pub fn wheel_action(self, action: UiAction) -> Self

Source

pub fn click_action(self, action: UiAction) -> Self

Source

pub fn action_target(self, target: UiId) -> Self

Source

pub fn on_action<F>(self, id: impl Into<ActionId>, handler: F) -> Self
where F: Fn(&mut UiEventContext, &UiAction) + Send + Sync + 'static,

Source

pub fn event_policy(self, policy: EventPolicy) -> Self

Source

pub fn auto_focus(self) -> Self

Source

pub fn focus_scope(self) -> Self

Source

pub fn animation(self, binding: AnimationBinding) -> Self

Source

pub fn animation_target(self, property: AnimProperty, active: bool) -> Self

Source

pub fn animation_outset(self, x: f32, y: f32) -> Self

Source

pub fn layout(self, layout: LayoutSpec) -> Self

Source

pub fn style(self, style: VisualStyle) -> Self

Source

pub fn path_content(self, path: UiPath, style: PathStyle) -> Self

Source

pub fn text_content( self, text: impl Into<Cow<'static, str>>, style: TextStyle, ) -> Self

Source

pub fn image_source( self, source: impl Into<UiImageSource>, fit: ImageFit, ) -> Self

Source

pub fn image_request( self, request: impl Into<ImageRequest>, fit: ImageFit, ) -> Self

Source

pub fn icon_key(self, key: &'static str) -> Self

Source

pub fn icon_style(self, style: IconStyle) -> Self

Source

pub fn glow_effect(self, color: Color, alpha: u8) -> Self

Source

pub fn overlay_style(self, style: OverlayStyle) -> Self

Source

pub fn backdrop_blur_style(self, style: BackdropBlurStyle) -> Self

Source

pub fn custom_style(self, style: CustomPaintStyle) -> Self

Source

pub fn static_layer_spec(self, spec: StaticLayerSpec) -> Self

Source

pub fn compositing_layer_spec(self, spec: CompositingLayerSpec) -> Self

Source

pub fn shadow(self, style: ShadowStyle) -> Self

Shadows this element and its subtree as one alpha silhouette, without changing layout.

Source

pub fn scroll_raster_spec(self, spec: ScrollRasterSpec) -> Self

Source

pub fn clip_content(self, rect: UiRect, offset_x: f32, offset_y: f32) -> Self

Source

pub fn hit_rect(self, rect: UiRect) -> Self

Source

pub fn paint_bounds(self, rect: UiRect) -> Self

Source

pub fn ime_cursor_rect(self, rect: UiRect) -> Self

Source

pub fn render_phase(self, phase: RenderPhase) -> Self

Source

pub fn translate(self, x: f32, y: f32) -> Self

Source

pub fn mount(self, builder: &mut HostTreeBuilder) -> UiId

Trait Implementations§

Source§

impl Clone for UiElement

Source§

fn clone(&self) -> UiElement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl UiComponent for UiElement

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.