redo event fn signature & add event_ctx macro
This commit is contained in:
@@ -100,10 +100,13 @@ impl<W: WidgetLike<Tag>, Tag> CoreWidget<W::Widget, Tag> for W {
|
||||
}
|
||||
|
||||
fn scroll(self) -> impl WidgetIdFn<Scroll> {
|
||||
event_ctx!(());
|
||||
|
||||
move |ui| {
|
||||
Scroll::new(self.add(ui).any(), Axis::Y)
|
||||
.edit_on(CursorSense::Scroll, |w, data| {
|
||||
w.scroll(data.scroll_delta.y * 50.0);
|
||||
.on(CursorSense::Scroll, |ctx| {
|
||||
let s = &mut ctx.ui[ctx.id];
|
||||
s.scroll(ctx.data.scroll_delta.y * 50.0);
|
||||
})
|
||||
.add(ui)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user