diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-04-04 22:26:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-04-04 22:26:03 +0000 |
commit | 847e8f06107293254606d499aeb3e8a2006b9b78 (patch) | |
tree | 186af36713f9085508da4f01707bfc8dc4447eac /libs | |
parent | 79c918fd6aace3f5d94fe61973819574489ca755 (diff) |
add some scroll wheel support to the scroomer
git-svn-id: svn://localhost/ardour2/branches/3.0@9287 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/scroomer.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libs/gtkmm2ext/scroomer.cc b/libs/gtkmm2ext/scroomer.cc index 40892301bc..3009449c91 100644 --- a/libs/gtkmm2ext/scroomer.cc +++ b/libs/gtkmm2ext/scroomer.cc @@ -203,6 +203,23 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev) } bool +Scroomer::on_scroll_event (GdkEventScroll* ev) +{ + switch (ev->direction) { + case GDK_SCROLL_UP: + adj.set_value (adj.get_value() - adj.get_page_size()/10.0); + break; + case GDK_SCROLL_DOWN: + adj.set_value (adj.get_value() + adj.get_page_size()/10.0); + break; + default: + return false; + } + + return true; +} + +bool Scroomer::on_button_press_event (GdkEventButton* ev) { if (ev->button == 1 || ev->button == 3) { @@ -267,12 +284,6 @@ Scroomer::on_button_release_event (GdkEventButton* ev) return true; } -bool -Scroomer::on_scroll_event (GdkEventScroll*) -{ - return true; -} - void Scroomer::on_size_allocate (Allocation& a) { |