backends: Add action label to mode switch buttons

https://bugzilla.gnome.org/show_bug.cgi?id=771098
This commit is contained in:
Carlos Garnacho 2016-12-28 12:06:41 +01:00
parent 07ce981cb0
commit efd9d467f2

View File

@ -1715,12 +1715,23 @@ meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_setti
guint button) guint button)
{ {
GDesktopPadButtonAction action; GDesktopPadButtonAction action;
gint group;
g_return_val_if_fail (META_IS_INPUT_SETTINGS (input_settings), NULL); 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_IS_INPUT_DEVICE (pad), NULL);
g_return_val_if_fail (clutter_input_device_get_device_type (pad) == g_return_val_if_fail (clutter_input_device_get_device_type (pad) ==
CLUTTER_PAD_DEVICE, NULL); 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); action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
switch (action) switch (action)