From e4edaa1ffaa6493510e5f026f4cb581249a642e5 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sun, 21 Jun 2015 20:38:03 +0200 Subject: [PATCH] Add Ctrl+Shift+mousewheel and Ctrl+Super+mousewheel actions to zoom receivers or all terminals --- terminatorlib/terminal.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 67466cf7..44dfa064 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -848,12 +848,20 @@ class Terminal(Gtk.VBox): SMOOTH_SCROLL_UP = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y <= 0. SMOOTH_SCROLL_DOWN = event.direction == Gdk.ScrollDirection.SMOOTH and event.delta_y > 0. if event.state & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK: - # Ctrl + mouse wheel up/down + # Ctrl + mouse wheel up/down with Shift and Super additions + if event.state & Gdk.ModifierType.MOD4_MASK == Gdk.ModifierType.MOD4_MASK: + targets=self.terminator.terminals + elif event.state & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK: + targets=self.terminator.get_target_terms(self) + else: + targets=[self] if event.direction == Gdk.ScrollDirection.UP or SMOOTH_SCROLL_UP: - self.zoom_in() + for target in targets: + target.zoom_in() return (True) elif event.direction == Gdk.ScrollDirection.DOWN or SMOOTH_SCROLL_DOWN: - self.zoom_out() + for target in targets: + target.zoom_out() return (True) if event.state & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK: # Shift + mouse wheel up/down