From 32db43e7ae2ad6692573c0b359d3172f84d99bef Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 29 Jul 2007 23:19:05 +0000 Subject: [PATCH] optionally zoom with mousewheel without modifiers --- src/event-context.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/event-context.cpp b/src/event-context.cpp index 47c5fac26..c6192c4c3 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -600,6 +600,9 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, } break; case GDK_SCROLL: + { + bool ctrl = (event->scroll.state & GDK_CONTROL_MASK); + bool wheelzooms = (prefs_get_int_attribute("options.wheelzooms","value", 0) == 1); /* shift + wheel, pan left--right */ if (event->scroll.state & GDK_SHIFT_MASK) { switch (event->scroll.direction) { @@ -614,7 +617,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, } /* ctrl + wheel, zoom in--out */ - } else if (event->scroll.state & GDK_CONTROL_MASK) { + } else if ((ctrl && !wheelzooms) || (!ctrl && wheelzooms)) { double rel_zoom; switch (event->scroll.direction) { case GDK_SCROLL_UP: @@ -650,6 +653,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, } } break; + } default: break; } -- 2.30.2