diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-10-14 08:00:27 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-10-14 08:00:27 +0000 |
| commit | e64e134d847ae7b741bf94839bd1b2c308984062 (patch) | |
| tree | 3630b4a6c8b50355eaa3374009e557f276e76a02 /src/ui/previewholder.cpp | |
| parent | GTK+ 3: Fix crash with live-preview checkbox in extensions dialog (diff) | |
| download | inkscape-e64e134d847ae7b741bf94839bd1b2c308984062.tar.gz inkscape-e64e134d847ae7b741bf94839bd1b2c308984062.zip | |
Fix for 171221 : color panel improvements
(bzr r11793)
Diffstat (limited to 'src/ui/previewholder.cpp')
| -rw-r--r-- | src/ui/previewholder.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp index 0dac18665..24049d2f9 100644 --- a/src/ui/previewholder.cpp +++ b/src/ui/previewholder.cpp @@ -17,6 +17,7 @@ #include <gtkmm/scrolledwindow.h> #include <gtkmm/sizegroup.h> #include <gtkmm/scrollbar.h> +#include <gtkmm/adjustment.h> #define COLUMNS_FOR_SMALL 16 #define COLUMNS_FOR_LARGE 8 @@ -56,9 +57,25 @@ PreviewHolder::PreviewHolder() : PreviewHolder::~PreviewHolder() { + } +bool PreviewHolder::on_scroll_event(GdkEventScroll *event) +{ + // Scroll horizontally by page on mouse wheel + Gtk::Adjustment *adj = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hadjustment(); + if (!adj) { + return FALSE; + } + + int move = (event->direction == GDK_SCROLL_DOWN) ? adj->get_page_size() : -adj->get_page_size(); + double value = std::min(adj->get_upper() - move, adj->get_value() + move ); + + adj->set_value(value); + + return FALSE; +} void PreviewHolder::clear() { |
