From 3f9f1af114230eb7ab15555dfdaca3ffcbbd3d54 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Wed, 28 Jul 2021 22:24:01 -0400 Subject: [PATCH] better scrolling slightly --- minigui.d | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/minigui.d b/minigui.d index 6552d3a..5bad512 100644 --- a/minigui.d +++ b/minigui.d @@ -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();