[mutter] backends: Add action label to mode switch buttons



commit efd9d467f2f6f4641249e7d2ddda4b01590157a9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Dec 28 12:06:41 2016 +0100

    backends: Add action label to mode switch buttons
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771098

 src/backends/meta-input-settings.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index a66c692..fc9a694 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1715,12 +1715,23 @@ meta_input_settings_get_pad_button_action_label (MetaInputSettings  *input_setti
                                                  guint               button)
 {
   GDesktopPadButtonAction action;
+  gint group;
 
   g_return_val_if_fail (META_IS_INPUT_SETTINGS (input_settings), NULL);
   g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (pad), NULL);
   g_return_val_if_fail (clutter_input_device_get_device_type (pad) ==
                         CLUTTER_PAD_DEVICE, NULL);
 
+  group = clutter_input_device_get_mode_switch_button_group (pad, button);
+
+  if (group >= 0)
+    {
+      /* TRANSLATORS: This string refers to a button that switches between
+       * different modes.
+       */
+      return g_strdup_printf (_("Mode Switch (Group %d)"), group);
+    }
+
   action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
 
   switch (action)


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