[Xfce4-commits] [apps/xfce4-terminal] 02/02: Add MiscMouseWheelZoom hidden setting to control the feature (on by default)

noreply at xfce.org noreply at xfce.org
Fri Sep 23 12:48:12 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 760d226a9c7f1d07dfba6413984949eba512ce3c
Author: Igor <f2404 at yandex.ru>
Date:   Fri Sep 23 13:46:43 2016 +0300

    Add MiscMouseWheelZoom hidden setting to control the feature (on by default)
    
    Also change the shortcut to Shift + Ctrl + wheel up/down to be less
    intrusive.
---
 terminal/terminal-preferences.c | 11 +++++++++++
 terminal/terminal-window.c      | 30 ++++++++++++++++++------------
 2 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 77374ed..2761576 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -83,6 +83,7 @@ enum
   PROP_MISC_INHERIT_GEOMETRY,
   PROP_MISC_MENUBAR_DEFAULT,
   PROP_MISC_MOUSE_AUTOHIDE,
+  PROP_MISC_MOUSE_WHEEL_ZOOM,
   PROP_MISC_TOOLBAR_DEFAULT,
   PROP_MISC_CONFIRM_CLOSE,
   PROP_MISC_CYCLE_TABS,
@@ -731,6 +732,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
   /**
+   * TerminalPreferences:misc-mouse-wheel-zoom:
+   **/
+  preferences_props[PROP_MISC_MOUSE_WHEEL_ZOOM] =
+      g_param_spec_boolean ("misc-mouse-wheel-zoom",
+                            NULL,
+                            "MiscMouseWheelZoom",
+                            TRUE,
+                            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+  /**
    * TerminalPreferences:misc-toolbar-default:
    **/
   preferences_props[PROP_MISC_TOOLBAR_DEFAULT] =
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 6bda29a..b4e3491 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -538,21 +538,27 @@ static gboolean
 terminal_window_scroll_event (GtkWidget      *widget,
                               GdkEventScroll *event)
 {
-    TerminalWindow *window = TERMINAL_WINDOW (widget);
+  gboolean mouse_wheel_zoom;
+  TerminalWindow *window = TERMINAL_WINDOW (widget);
 
-    if (event->state == GDK_CONTROL_MASK && event->direction == GDK_SCROLL_UP)
-      {
-        terminal_window_action_zoom_in (NULL, window);
-        return TRUE;
-      }
+  g_object_get (G_OBJECT (window->preferences),
+                "misc-mouse-wheel-zoom", &mouse_wheel_zoom, NULL);
 
-    if (event->state == GDK_CONTROL_MASK && event->direction == GDK_SCROLL_DOWN)
-      {
-        terminal_window_action_zoom_out (NULL, window);
-        return TRUE;
-      }
+  if (mouse_wheel_zoom && event->state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK)
+      && event->direction == GDK_SCROLL_UP)
+    {
+      terminal_window_action_zoom_in (NULL, window);
+      return TRUE;
+    }
 
-    return FALSE;
+  if (mouse_wheel_zoom && event->state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK)
+      && event->direction == GDK_SCROLL_DOWN)
+    {
+      terminal_window_action_zoom_out (NULL, window);
+      return TRUE;
+    }
+
+  return FALSE;
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list