pub struct ClickArea { /* private fields */ }Expand description
Transparent rectangular hit area with an optional click callback.
Designed for the QML MouseArea lowering shipped by phase QT-04d
(docs/qt-support/04d-mousearea.md). The widget intentionally
has no visual: its Widget::draw is a no-op so the area never
occludes its parent’s pixels. Hit-testing happens on
Event::PressRelease.
Implementations§
Source§impl ClickArea
impl ClickArea
Sourcepub fn set_on_click<F: FnMut(&mut Self) + 'static>(&mut self, handler: F)
pub fn set_on_click<F: FnMut(&mut Self) + 'static>(&mut self, handler: F)
Register a callback invoked when a click is released inside
bounds. The callback receives &mut self so it can mutate
the click area itself (e.g. resize after a click) — though
QT-04d’s emitted closures typically only mutate ScreenState
captured by reference.
Trait Implementations§
Source§impl Widget for ClickArea
impl Widget for ClickArea
Source§fn handle_event(&mut self, event: &Event) -> bool
fn handle_event(&mut self, event: &Event) -> bool
Handle an event and return
true if it was consumed. Read moreSource§fn clear_region(&mut self) -> Option<Rect>
fn clear_region(&mut self) -> Option<Rect>
Return a region (in draw/landscape coordinates) that should be
restored from the pristine background copy, or
None. Read moreSource§fn set_bounds(&mut self, _bounds: Rect)
fn set_bounds(&mut self, _bounds: Rect)
Called by the LPAR-10 layout pass to notify this widget of its
layout-computed bounds. Read more
Source§fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
Expose this widget’s font slot for cascade-driven font resolution
(FONT-05 §5.B). Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ClickArea
impl !Send for ClickArea
impl !Sync for ClickArea
impl !UnwindSafe for ClickArea
impl Freeze for ClickArea
impl Unpin for ClickArea
impl UnsafeUnpin for ClickArea
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