Skip to main content

UiNode

Struct UiNode 

Source
pub struct UiNode {
Show 45 fields pub id: UiId, pub component_owner: Option<ComponentId>, pub parent: Option<UiId>, pub kind: UiNodeKind, pub layout_rect: UiRect, pub hit_rect: UiRect, pub paint_bounds: UiRect, pub ime_cursor_rect: Option<UiRect>, pub interaction: InteractionRole, pub semantics: Option<Semantics>, pub click_capture_handler: Option<UiEventHandler>, pub click_handler: Option<UiEventHandler>, pub input_event_handlers: Vec<UiInputEventBinding>, pub click_action: Option<UiAction>, pub wheel_action: Option<UiAction>, pub action_target: Option<UiId>, pub action_handlers: Vec<UiActionBinding>, pub event_policy: EventPolicy, pub auto_focus: bool, pub focus_scope: bool, pub animation_bindings: Vec<AnimationBinding>, pub animation_targets: Vec<(AnimProperty, bool)>, pub animation_outset: (f32, f32), pub layout: LayoutSpec, pub style: VisualStyle, pub path: Option<UiPath>, pub path_style: PathStyle, pub image_request: Option<ImageRequest>, pub image_fit: ImageFit, pub icon_key: Option<&'static str>, pub icon_style: IconStyle, pub glow: Option<(Color, u8)>, pub backdrop_blur_style: Option<BackdropBlurStyle>, pub overlay_style: Option<OverlayStyle>, pub custom_style: Option<CustomPaintStyle>, pub compositing_layer: Option<CompositingLayerSpec>, pub shadow: Option<ShadowStyle>, pub static_layer: Option<StaticLayerSpec>, pub scroll_raster: Option<ScrollRasterSpec>, pub clip_rect: Option<UiRect>, pub content_offset: (f32, f32), pub text: Option<Cow<'static, str>>, pub text_style: Option<TextStyle>, pub render_phase: RenderPhase, pub children: Vec<UiId>,
}

Fields§

§id: UiId§component_owner: Option<ComponentId>§parent: Option<UiId>§kind: UiNodeKind§layout_rect: UiRect§hit_rect: UiRect§paint_bounds: UiRect§ime_cursor_rect: Option<UiRect>§interaction: InteractionRole§semantics: Option<Semantics>§click_capture_handler: Option<UiEventHandler>§click_handler: Option<UiEventHandler>§input_event_handlers: Vec<UiInputEventBinding>§click_action: Option<UiAction>§wheel_action: Option<UiAction>§action_target: Option<UiId>§action_handlers: Vec<UiActionBinding>§event_policy: EventPolicy§auto_focus: bool§focus_scope: bool§animation_bindings: Vec<AnimationBinding>§animation_targets: Vec<(AnimProperty, bool)>§animation_outset: (f32, f32)§layout: LayoutSpec§style: VisualStyle§path: Option<UiPath>§path_style: PathStyle§image_request: Option<ImageRequest>§image_fit: ImageFit§icon_key: Option<&'static str>§icon_style: IconStyle§glow: Option<(Color, u8)>§backdrop_blur_style: Option<BackdropBlurStyle>§overlay_style: Option<OverlayStyle>§custom_style: Option<CustomPaintStyle>§compositing_layer: Option<CompositingLayerSpec>§shadow: Option<ShadowStyle>§static_layer: Option<StaticLayerSpec>§scroll_raster: Option<ScrollRasterSpec>§clip_rect: Option<UiRect>§content_offset: (f32, f32)§text: Option<Cow<'static, str>>§text_style: Option<TextStyle>§render_phase: RenderPhase§children: Vec<UiId>

Implementations§

Source§

impl UiNode

Source

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

Source

pub fn parent(self, parent: UiId) -> 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 interaction(self, interaction: InteractionRole) -> Self

Source

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

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_capture_handler(self, handler: UiEventHandler) -> Self

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 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 on_action_handler( self, id: impl Into<ActionId>, handler: UiActionHandler, ) -> Self

Source

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

Source

pub fn auto_focus(self, enabled: bool) -> Self

Source

pub fn focus_scope(self, enabled: bool) -> 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(self, path: UiPath, style: PathStyle) -> Self

Source

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

Source

pub fn image(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(self, key: &'static str) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for UiNode

Source§

fn clone(&self) -> UiNode

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

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.