pub struct UiElement { /* private fields */ }Implementations§
Source§impl UiElement
impl UiElement
pub fn new(id: UiId, kind: UiNodeKind, rect: UiRect) -> Self
pub fn group(id: UiId, rect: UiRect) -> Self
pub fn panel(id: UiId, rect: UiRect, style: VisualStyle) -> Self
pub fn text( id: UiId, rect: UiRect, text: impl Into<Cow<'static, str>>, style: TextStyle, ) -> Self
pub fn custom(id: UiId, rect: UiRect, key: &'static str) -> Self
pub fn custom_paint( id: UiId, rect: UiRect, key: &'static str, style: CustomPaintStyle, ) -> Self
pub fn image( id: UiId, rect: UiRect, source: &'static str, fit: ImageFit, ) -> Self
pub fn file_image( id: UiId, rect: UiRect, source: impl Into<PathBuf>, fit: ImageFit, ) -> Self
pub fn requested_image( id: UiId, rect: UiRect, request: impl Into<ImageRequest>, fit: ImageFit, ) -> Self
pub fn icon(id: UiId, rect: UiRect, key: &'static str) -> Self
pub fn glow(id: UiId, rect: UiRect, color: Color, alpha: u8) -> Self
pub fn backdrop_blur(id: UiId, rect: UiRect, style: BackdropBlurStyle) -> Self
pub fn backdrop_blur_path( id: UiId, rect: UiRect, path: UiPath, style: BackdropBlurStyle, ) -> Self
pub fn overlay(id: UiId, rect: UiRect, style: OverlayStyle) -> Self
pub fn static_layer(id: UiId, rect: UiRect, spec: StaticLayerSpec) -> Self
pub fn compositing_layer( id: UiId, rect: UiRect, spec: CompositingLayerSpec, ) -> Self
pub fn scroll_raster(id: UiId, viewport: UiRect, spec: ScrollRasterSpec) -> Self
pub fn clip(id: UiId, rect: UiRect, offset_x: f32, offset_y: f32) -> Self
pub fn clip_path(id: UiId, rect: UiRect, path: UiPath) -> Self
pub fn line(id: UiId, rect: UiRect, style: VisualStyle) -> Self
pub fn path(id: UiId, rect: UiRect, path: UiPath, style: PathStyle) -> Self
pub fn ellipse(id: UiId, rect: UiRect, style: VisualStyle) -> Self
pub fn node(&self) -> &UiNode
pub fn children_ref(&self) -> &[UiElement]
pub fn child(self, child: UiElement) -> Self
pub fn children(self, children: impl IntoIterator<Item = UiElement>) -> Self
pub fn interaction(self, interaction: InteractionRole) -> Self
pub fn semantics(self, semantics: Semantics) -> Self
Sourcepub fn window_drag_region(self) -> Self
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.
pub fn on_click<F>(self, handler: F) -> Self
pub fn on_click_handler(self, handler: UiEventHandler) -> Self
pub fn on_click_async<F, Fut>(self, handler: F) -> Self
pub fn on_click_capture<F>(self, handler: F) -> Self
pub fn on_event_handler( self, kind: UiEventKind, capture: bool, handler: UiInputEventHandler, ) -> Self
pub fn on_event<F>(self, kind: UiEventKind, handler: F) -> Self
pub fn on_event_capture<F>(self, kind: UiEventKind, handler: F) -> Self
pub fn on_click_capture_handler(self, handler: UiEventHandler) -> Self
pub fn wheel_action(self, action: UiAction) -> Self
pub fn click_action(self, action: UiAction) -> Self
pub fn action_target(self, target: UiId) -> Self
pub fn on_action<F>(self, id: impl Into<ActionId>, handler: F) -> Self
pub fn event_policy(self, policy: EventPolicy) -> Self
pub fn auto_focus(self) -> Self
pub fn focus_scope(self) -> Self
pub fn animation(self, binding: AnimationBinding) -> Self
pub fn animation_target(self, property: AnimProperty, active: bool) -> Self
pub fn animation_outset(self, x: f32, y: f32) -> Self
pub fn layout(self, layout: LayoutSpec) -> Self
pub fn style(self, style: VisualStyle) -> Self
pub fn path_content(self, path: UiPath, style: PathStyle) -> Self
pub fn text_content( self, text: impl Into<Cow<'static, str>>, style: TextStyle, ) -> Self
pub fn image_source( self, source: impl Into<UiImageSource>, fit: ImageFit, ) -> Self
pub fn image_request( self, request: impl Into<ImageRequest>, fit: ImageFit, ) -> Self
pub fn icon_key(self, key: &'static str) -> Self
pub fn icon_style(self, style: IconStyle) -> Self
pub fn glow_effect(self, color: Color, alpha: u8) -> Self
pub fn overlay_style(self, style: OverlayStyle) -> Self
pub fn backdrop_blur_style(self, style: BackdropBlurStyle) -> Self
pub fn custom_style(self, style: CustomPaintStyle) -> Self
pub fn static_layer_spec(self, spec: StaticLayerSpec) -> Self
pub fn compositing_layer_spec(self, spec: CompositingLayerSpec) -> Self
Sourcepub fn shadow(self, style: ShadowStyle) -> Self
pub fn shadow(self, style: ShadowStyle) -> Self
Shadows this element and its subtree as one alpha silhouette, without changing layout.
pub fn scroll_raster_spec(self, spec: ScrollRasterSpec) -> Self
pub fn clip_content(self, rect: UiRect, offset_x: f32, offset_y: f32) -> Self
pub fn hit_rect(self, rect: UiRect) -> Self
pub fn paint_bounds(self, rect: UiRect) -> Self
pub fn ime_cursor_rect(self, rect: UiRect) -> Self
pub fn render_phase(self, phase: RenderPhase) -> Self
pub fn translate(self, x: f32, y: f32) -> Self
pub fn mount(self, builder: &mut HostTreeBuilder) -> UiId
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UiElement
impl !UnwindSafe for UiElement
impl Freeze for UiElement
impl Send for UiElement
impl Sync for UiElement
impl Unpin for UiElement
impl UnsafeUnpin for UiElement
Blanket Implementations§
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