summaryrefslogtreecommitdiff
path: root/src/Page.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 15:55:20 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 15:55:20 +0100
commitf6140ff1c9ec493d947da5b346508846e7a1a06f (patch)
treec01b9164ee4b0d46b6670ccee45f6181c6237d7f /src/Page.vala
parent0f67b3cc674377559e66c5a6729fd499049a992f (diff)
parent2492891f112caac6076ce49721d9d5d78a152c3a (diff)
Update upstream source from tag 'upstream/0.26.4'
Update to upstream version '0.26.4' with Debian dir fae3cc48a8ec2f37979206f90dc828cbebee14c4
Diffstat (limited to 'src/Page.vala')
-rw-r--r--src/Page.vala22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/Page.vala b/src/Page.vala
index 7504743..88fecc7 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -174,7 +174,7 @@ public abstract class Page : Gtk.ScrolledWindow {
event_source.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK
| Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK
| Gdk.EventMask.BUTTON_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK
- | Gdk.EventMask.SCROLL_MASK);
+ | Gdk.EventMask.SCROLL_MASK | Gdk.EventMask.SMOOTH_SCROLL_MASK);
event_source.button_press_event.connect(on_button_pressed_internal);
event_source.button_release_event.connect(on_button_released_internal);
event_source.motion_notify_event.connect(on_motion_internal);
@@ -1038,6 +1038,23 @@ public abstract class Page : Gtk.ScrolledWindow {
case Gdk.ScrollDirection.RIGHT:
return on_mousewheel_right(event);
+
+ case Gdk.ScrollDirection.SMOOTH:
+ {
+ double dx, dy;
+ event.get_scroll_deltas(out dx, out dy);
+
+ if (dy < 0)
+ return on_mousewheel_up(event);
+ else if (dy > 0)
+ return on_mousewheel_down(event);
+ else if (dx < 0)
+ return on_mousewheel_left(event);
+ else if (dx > 0)
+ return on_mousewheel_right(event);
+ else
+ return false;
+ }
default:
return false;
@@ -1301,6 +1318,9 @@ public abstract class CheckerboardPage : Page {
private Gtk.Menu page_context_menu;
public override Gtk.Menu? get_page_context_menu() {
+ if (page_context_menu_path == null)
+ return null;
+
if (page_context_menu == null) {
var model = this.builder.get_object (page_context_menu_path)
as GLib.MenuModel;