better scrolling slightly

This commit is contained in:
Adam D. Ruppe 2021-07-28 22:24:01 -04:00
parent 81dba0f46d
commit 3f9f1af114
1 changed files with 14 additions and 5 deletions

View File

@ -4198,15 +4198,24 @@ class ScrollableContainerWidget : ContainerWidget {
vsb.addEventListener((scope ScrollToPositionEvent spe) {
scrollTo(scrollX_, spe.value);
});
this.addEventListener(delegate (scope ClickEvent e) {
if(e.button == MouseButton.wheelUp) {
if(!e.defaultPrevented)
scrollBy(0, -16);
e.stopPropagation();
} else if(e.button == MouseButton.wheelDown) {
if(!e.defaultPrevented)
scrollBy(0, 16);
e.stopPropagation();
}
});
}
/+
override void defaultEventHandler_click(ClickEvent e) {
if(e.button == MouseButton.wheelUp) {
scrollBy(0, -16);
} else if(e.button == MouseButton.wheelDown) {
scrollBy(0, 16);
}
}
+/
override void removeAllChildren() {
container.removeAllChildren();