small QOL
This commit is contained in:
@@ -83,13 +83,13 @@ widget_trait! {
|
||||
}
|
||||
}
|
||||
|
||||
fn scroll(self) -> impl WidgetIdFn<State, Scroll<State>> {
|
||||
fn scrollable(self) -> impl WidgetIdFn<State, Scroll<State>> {
|
||||
use eventable::*;
|
||||
move |ui| {
|
||||
Scroll::new(self.add(ui), Axis::Y)
|
||||
.on(CursorSense::Scroll, |ctx| {
|
||||
let s = &mut ctx.state.ui()[ctx.widget];
|
||||
s.scroll(ctx.data.scroll_delta.y * 50.0);
|
||||
.on(CursorSense::Scroll, |mut ctx| {
|
||||
let delta = ctx.data.scroll_delta.y * 50.0;
|
||||
ctx.widget().scroll(delta);
|
||||
})
|
||||
.add(ui)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user