[gnome-control-center/gbsneto/keyboard-shortcuts-rename: 4/4] keyboard: Move "Reset All" to the start of the headerbar
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/keyboard-shortcuts-rename: 4/4] keyboard: Move "Reset All" to the start of the headerbar
- Date: Tue, 21 May 2019 16:07:35 +0000 (UTC)
commit 5ec241aae28d9568ad4a7ec5cb5f38585ad31303
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue May 21 13:00:32 2019 -0300
keyboard: Move "Reset All" to the start of the headerbar
https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
panels/keyboard/cc-keyboard-panel.c | 9 +++++++--
panels/keyboard/cc-keyboard-panel.ui | 26 ++++++++++----------------
2 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c
index fc2639265..56fa08b4f 100644
--- a/panels/keyboard/cc-keyboard-panel.c
+++ b/panels/keyboard/cc-keyboard-panel.c
@@ -47,6 +47,7 @@ struct _CcKeyboardPanel
/* Search */
GtkWidget *empty_search_placeholder;
+ GtkWidget *reset_button;
GtkWidget *search_bar;
GtkWidget *search_button;
GtkWidget *search_entry;
@@ -645,14 +646,17 @@ cc_keyboard_panel_constructed (GObject *object)
{
CcKeyboardPanel *self = CC_KEYBOARD_PANEL (object);
GtkWindow *toplevel;
+ CcShell *shell;
G_OBJECT_CLASS (cc_keyboard_panel_parent_class)->constructed (object);
/* Setup the dialog's transient parent */
- toplevel = GTK_WINDOW (cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL (self))));
+ shell = cc_panel_get_shell (CC_PANEL (self));
+ toplevel = GTK_WINDOW (cc_shell_get_toplevel (shell));
gtk_window_set_transient_for (GTK_WINDOW (self->shortcut_editor), toplevel);
- cc_shell_embed_widget_in_header (cc_panel_get_shell (CC_PANEL (self)), self->search_button, GTK_POS_RIGHT);
+ cc_shell_embed_widget_in_header (shell, self->reset_button, GTK_POS_LEFT);
+ cc_shell_embed_widget_in_header (shell, self->search_button, GTK_POS_RIGHT);
self->search_bar_handler_id =
g_signal_connect_swapped (toplevel,
@@ -681,6 +685,7 @@ cc_keyboard_panel_class_init (CcKeyboardPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, add_shortcut_row);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, empty_search_placeholder);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, listbox);
+ gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, reset_button);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, search_bar);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, search_button);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, search_entry);
diff --git a/panels/keyboard/cc-keyboard-panel.ui b/panels/keyboard/cc-keyboard-panel.ui
index 7001d6d00..d562a6f80 100644
--- a/panels/keyboard/cc-keyboard-panel.ui
+++ b/panels/keyboard/cc-keyboard-panel.ui
@@ -53,22 +53,6 @@
<property name="margin_right">18</property>
<property name="spacing">12</property>
<property name="halign">center</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <child>
- <object class="GtkButton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Reset All…</property>
- <property name="tooltip-text" translatable="yes">Reset all shortcuts to their
default keybindings</property>
- <signal name="clicked" handler="reset_all_clicked_cb" object="CcKeyboardPanel"
swapped="yes" />
- </object>
- </child>
- </object>
- </child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
@@ -112,6 +96,8 @@
</object>
</child>
</template>
+
+ <!-- Header widgets -->
<object class="GtkToggleButton" id="search_button">
<property name="visible">True</property>
<style>
@@ -124,6 +110,14 @@
</object>
</child>
</object>
+ <object class="GtkButton" id="reset_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Reset All…</property>
+ <property name="tooltip-text" translatable="yes">Reset all shortcuts to their default
keybindings</property>
+ <signal name="clicked" handler="reset_all_clicked_cb" object="CcKeyboardPanel" swapped="yes" />
+ </object>
+
<object class="GtkBox" id="empty_search_placeholder">
<property name="visible">True</property>
<property name="can_focus">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]