diff --git a/src/dlangui/widgets/lists.d b/src/dlangui/widgets/lists.d index d3142278..94972cab 100644 --- a/src/dlangui/widgets/lists.d +++ b/src/dlangui/widgets/lists.d @@ -1085,6 +1085,11 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler { } else { scrollOffset.x = _scrollPosition; } + if (event.action == MouseAction.Wheel) { + if (_scrollbar) + _scrollbar.sendScrollEvent(event.wheelDelta > 0 ? ScrollAction.LineUp : ScrollAction.LineDown); + return true; + } if (event.action == MouseAction.ButtonDown && (event.flags & (MouseFlag.LButton || MouseFlag.RButton))) setFocus(); for (int i = 0; i < itemCount; i++) { diff --git a/src/dlangui/widgets/tree.d b/src/dlangui/widgets/tree.d index d0bdcdc0..707aedba 100644 --- a/src/dlangui/widgets/tree.d +++ b/src/dlangui/widgets/tree.d @@ -857,6 +857,22 @@ class TreeWidgetBase : ScrollWidget, OnTreeContentChangeListener, OnTreeStateCh selectItem(item, makeVisible); } + /// process mouse event; return true if event is processed by widget. + override bool onMouseEvent(MouseEvent event) { + if (event.action == MouseAction.Wheel) { + if (event.flags == MouseFlag.Control) { + if (_hscrollbar) + _hscrollbar.sendScrollEvent(event.wheelDelta > 0 ? ScrollAction.LineUp : ScrollAction.LineDown); + return true; + } else if (event.flags == 0) { + if (_vscrollbar) + _vscrollbar.sendScrollEvent(event.wheelDelta > 0 ? ScrollAction.LineUp : ScrollAction.LineDown); + return true; + } + } + return super.onMouseEvent(event); + } + override protected bool handleAction(const Action a) { Log.d("tree.handleAction ", a.id); switch (a.id) with(TreeActions)