From e2848f1f5515c7ca3a8558b09474aeb4ad89d675 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 19 Feb 2011 23:44:17 -0300 Subject: [PATCH] Add support for vertical-scrolling with mouse wheel in PaletteView widget. --- src/widgets/palette_view.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/widgets/palette_view.cpp b/src/widgets/palette_view.cpp index b2562657a..846e222f6 100644 --- a/src/widgets/palette_view.cpp +++ b/src/widgets/palette_view.cpp @@ -554,6 +554,21 @@ bool PaletteView::onProcessMessage(JMessage msg) case JM_BUTTONRELEASED: releaseMouse(); return true; + + case JM_WHEEL: { + JWidget view = jwidget_get_view(this); + if (view) { + int scroll_x, scroll_y; + + jview_get_scroll(view, &scroll_x, &scroll_y); + jview_set_scroll(view, + scroll_x, + scroll_y + + (jmouse_z(1) - jmouse_z(0)) * 3*m_boxsize); + } + break; + } + } return Widget::onProcessMessage(msg);