summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/rotateable.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-10-23 05:43:40 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-10-23 05:43:40 +0000
commit3c8f6b5ed34852b06b38b1046d4d9042155c96a2 (patch)
tree663d7b067f769d925d01aa296b9848fcaf877a79 /src/ui/widget/rotateable.cpp
parentupdate cmake files & make function static. (diff)
downloadinkscape-3c8f6b5ed34852b06b38b1046d4d9042155c96a2.tar.gz
inkscape-3c8f6b5ed34852b06b38b1046d4d9042155c96a2.zip
Fix for 171890 : Mouse wheel on swatches
(bzr r11822)
Diffstat (limited to 'src/ui/widget/rotateable.cpp')
-rw-r--r--src/ui/widget/rotateable.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp
index 7be666843..1d91515e5 100644
--- a/src/ui/widget/rotateable.cpp
+++ b/src/ui/widget/rotateable.cpp
@@ -24,12 +24,15 @@ Rotateable::Rotateable():
{
dragging = false;
working = false;
+ scrolling = false;
modifier = 0;
current_axis = axis;
signal_button_press_event().connect(sigc::mem_fun(*this, &Rotateable::on_click));
signal_motion_notify_event().connect(sigc::mem_fun(*this, &Rotateable::on_motion));
signal_button_release_event().connect(sigc::mem_fun(*this, &Rotateable::on_release));
+ signal_scroll_event().connect(sigc::mem_fun(*this, &Rotateable::on_scroll));
+
}
bool Rotateable::on_click(GdkEventButton *event) {
@@ -124,6 +127,34 @@ bool Rotateable::on_release(GdkEventButton *event) {
return false;
}
+bool Rotateable::on_scroll(GdkEventScroll* event)
+{
+ double change = 0.0;
+
+ if (event->direction == GDK_SCROLL_UP) {
+ change = 1.0;
+ } else if (event->direction == GDK_SCROLL_DOWN) {
+ change = -1.0;
+ } else {
+ return FALSE;
+ }
+
+ drag_started_x = event->x;
+ drag_started_y = event->y;
+ modifier = get_single_modifier(modifier, event->state);
+ dragging = false;
+ working = false;
+ scrolling = true;
+ current_axis = axis;
+
+ do_scroll(change, modifier);
+
+ dragging = false;
+ working = false;
+ scrolling = false;
+
+ return TRUE;
+}
Rotateable::~Rotateable() {
}