[gnome-control-center/wip/gbsneto/keyboard-improvements: 7/16] shortcut-editor: add 'Set' button
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/gbsneto/keyboard-improvements: 7/16] shortcut-editor: add 'Set' button
- Date: Tue, 6 Sep 2016 15:07:17 +0000 (UTC)
commit 4932552261aefdf91823136fff10bc487e44f37d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Aug 30 11:42:09 2016 -0300
shortcut-editor: add 'Set' button
The Set button will be used to update a standard
shortcut.
This patch adds it to the headerbar.
https://bugzilla.gnome.org/show_bug.cgi?id=769314
panels/keyboard/cc-keyboard-shortcut-editor.c | 10 ++++++++++
panels/keyboard/shortcut-editor.ui | 16 ++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index 37e4eed..e9f9005 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -44,6 +44,7 @@ struct _CcKeyboardShortcutEditor
GtkWidget *remove_button;
GtkWidget *replace_button;
GtkWidget *reset_button;
+ GtkWidget *set_button;
GtkWidget *shortcut_accel_label;
GtkWidget *shortcut_conflict_label;
GtkWidget *stack;
@@ -421,6 +422,13 @@ reset_item_clicked_cb (CcKeyboardShortcutEditor *self)
}
static void
+set_button_clicked_cb (CcKeyboardShortcutEditor *self)
+{
+ update_shortcut (self);
+ gtk_widget_hide (GTK_WIDGET (self));
+}
+
+static void
setup_keyboard_item (CcKeyboardShortcutEditor *self,
CcKeyboardItem *item)
{
@@ -689,6 +697,7 @@ cc_keyboard_shortcut_editor_class_init (CcKeyboardShortcutEditorClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, remove_button);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, replace_button);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, reset_button);
+ gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, set_button);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, shortcut_accel_label);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, shortcut_conflict_label);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardShortcutEditor, stack);
@@ -702,6 +711,7 @@ cc_keyboard_shortcut_editor_class_init (CcKeyboardShortcutEditorClass *klass)
gtk_widget_class_bind_template_callback (widget_class, remove_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, replace_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, reset_item_clicked_cb);
+ gtk_widget_class_bind_template_callback (widget_class, set_button_clicked_cb);
}
static void
diff --git a/panels/keyboard/shortcut-editor.ui b/panels/keyboard/shortcut-editor.ui
index 81b5dc3..4cdbf42 100644
--- a/panels/keyboard/shortcut-editor.ui
+++ b/panels/keyboard/shortcut-editor.ui
@@ -262,6 +262,22 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="set_button">
+ <property name="label" translatable="yes">Set</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="set_button_clicked_cb" object="CcKeyboardShortcutEditor"
swapped="yes" />
+ <style>
+ <class name="suggested-action" />
+ </style>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
</child>
</template>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]