From 8bea8fc5979ad8e2c6718aa16e4a57eb7443d42f Mon Sep 17 00:00:00 2001 From: bulia byak Date: Tue, 30 Oct 2007 18:10:41 +0000 Subject: add alt dragging for no change mode (bzr r3974) --- src/ui/widget/rotateable.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src/ui/widget/rotateable.cpp') diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp index 9941c10f8..8cc3c88e9 100644 --- a/src/ui/widget/rotateable.cpp +++ b/src/ui/widget/rotateable.cpp @@ -50,25 +50,35 @@ bool Rotateable::on_click(GdkEventButton *event) { guint Rotateable::get_single_modifier(guint old, guint state) { - if (old == 0) { + if (old == 0 || old == 3) { if (state & GDK_CONTROL_MASK) return 1; // ctrl if (state & GDK_SHIFT_MASK) return 2; // shift + if (state & GDK_MOD1_MASK) + return 3; // alt return 0; } else { - if (!(state & GDK_CONTROL_MASK) && !(state & GDK_SHIFT_MASK)) - return 0; // none - if (old == 1) + if (!(state & GDK_CONTROL_MASK) && !(state & GDK_SHIFT_MASK)) { + if (state & GDK_MOD1_MASK) + return 3; // alt + else + return 0; // none + } + if (old == 1) { if (state & GDK_SHIFT_MASK && !(state & GDK_CONTROL_MASK)) return 2; // shift - else - return 1; - if (old == 2) + if (state & GDK_MOD1_MASK && !(state & GDK_CONTROL_MASK)) + return 3; // alt + return 1; + } + if (old == 2) { if (state & GDK_CONTROL_MASK && !(state & GDK_SHIFT_MASK)) return 1; // ctrl - else - return 2; + if (state & GDK_MOD1_MASK && !(state & GDK_SHIFT_MASK)) + return 3; // alt + return 2; + } return old; } } -- cgit v1.2.3