[gtk+] GtkShortcutsShortcut: Support single finger swipe gestures



commit b6cdc3961a20f2f8be25c67c8eb7a0a4a0bada51
Author: Felix Riemann <friemann gnome org>
Date:   Thu Oct 13 16:36:47 2016 +0200

    GtkShortcutsShortcut: Support single finger swipe gestures
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772770

 gtk/Makefile.am            |    2 ++
 gtk/gtkshortcutsshortcut.c |   16 ++++++++++++++++
 gtk/gtkshortcutsshortcut.h |    8 +++++++-
 3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 75bc6f5..79fc515 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1320,6 +1320,8 @@ gesture_sources =                                 \
        gesture/gesture-stretch-symbolic.svg                    \
        gesture/gesture-rotate-clockwise-symbolic.svg           \
        gesture/gesture-rotate-anticlockwise-symbolic.svg       \
+       gesture/gesture-swipe-left-symbolic.svg                 \
+       gesture/gesture-swipe-right-symbolic.svg                \
        gesture/gesture-two-finger-swipe-left-symbolic.svg      \
        gesture/gesture-two-finger-swipe-right-symbolic.svg
 
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index ca06eab..1767f0d 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -156,6 +156,14 @@ update_subtitle_from_type (GtkShortcutsShortcut *self)
       subtitle = _("Two finger swipe right");
       break;
 
+    case GTK_SHORTCUT_GESTURE_SWIPE_LEFT:
+      subtitle = _("Swipe left");
+      break;
+
+    case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT:
+      subtitle = _("Swipe right");
+      break;
+
     default:
       subtitle = NULL;
       break;
@@ -223,6 +231,14 @@ update_icon_from_type (GtkShortcutsShortcut *self)
       icon = g_themed_icon_new ("gesture-two-finger-swipe-right-symbolic");
       break;
 
+    case GTK_SHORTCUT_GESTURE_SWIPE_LEFT:
+      icon = g_themed_icon_new ("gesture-swipe-left-symbolic");
+      break;
+
+    case GTK_SHORTCUT_GESTURE_SWIPE_RIGHT:
+      icon = g_themed_icon_new ("gesture-swipe-right-symbolic");
+      break;
+
     default: ;
       icon = NULL;
       break;
diff --git a/gtk/gtkshortcutsshortcut.h b/gtk/gtkshortcutsshortcut.h
index 435e1bf..4f219a5 100644
--- a/gtk/gtkshortcutsshortcut.h
+++ b/gtk/gtkshortcutsshortcut.h
@@ -54,6 +54,10 @@ typedef struct _GtkShortcutsShortcutClass GtkShortcutsShortcutClass;
  * @GTK_SHORTCUT_GESTURE:
  *   The shortcut is a gesture. The #GtkShortcutsShortcut:icon property will be
  *   used.
+ * @GTK_SHORTCUT_GESTURE_SWIPE_LEFT:
+ *   The shortcut is a swipe gesture. GTK+ provides and icon and subtitle. Since 3.90
+ * @GTK_SHORTCUT_GESTURE_SWIPE_RIGHT:
+ *   The shortcut is a swipe gesture. GTK+ provides and icon and subtitle. Since 3.90
  *
  * GtkShortcutType specifies the kind of shortcut that is being described.
  * More values may be added to this enumeration over time.
@@ -68,7 +72,9 @@ typedef enum {
   GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE,
   GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT,
   GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT,
-  GTK_SHORTCUT_GESTURE
+  GTK_SHORTCUT_GESTURE,
+  GTK_SHORTCUT_GESTURE_SWIPE_LEFT,
+  GTK_SHORTCUT_GESTURE_SWIPE_RIGHT
 } GtkShortcutType;
 
 GDK_AVAILABLE_IN_3_20


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]