cloud storage client
git clone https://git.lucas.co/cce-cloud.git
refactor: dyn dispatch via handle_event (cce-ui 6bd direct-dispatch collapse)
The per-method entry points left WidgetHost; dyn-pointer deliveries build
the equivalent Event and hand it to handle_event — the same funnel the
entry points forwarded to.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk
src/json_layout.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/json_layout.rs b/src/json_layout.rs
index 0783000..cdbf4cf 100644
--- a/src/json_layout.rs
+++ b/src/json_layout.rs
@@ -407,9 +407,11 @@ impl JsonLayoutWidget {
Event::PointerMove { x, y, .. } => {
if let Some(idx) = self.dragging_slider_idx {
if let Some(w) = self.widgets.get_mut(idx) {
- // drag_update is an WidgetHost method (the Adapted forward supplies the
- // widget's rect); call it on the box, not a concrete downcast.
- if w.widget.as_dyn_mut().drag_update(*x, *y) {
+ // Drag* events map onto the Input drag hooks in handle_event (6bd
+ // collapse); the ctx is unused on that path.
+ let mut dummy = cce_ui::context::UiContext::new();
+ let ev = Event::DragUpdate { dx: 0.0, dy: 0.0, x: *x, y: *y, local_x: *x, local_y: *y };
+ if w.widget.as_dyn_mut().handle_event(&ev, &mut dummy) {
changed = true;
}
}