[gnome-control-center] keyboard: Move Remove button to the header bar
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] keyboard: Move Remove button to the header bar
- Date: Tue, 2 May 2017 10:21:00 +0000 (UTC)
commit dce6fe6adde209084f487d156d7b037fda484934
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon May 1 20:58:26 2017 -0300
keyboard: Move Remove button to the header bar
According to the mockups [1], the Remove button should
be placed at the start of the header bar. Currently,
however, it is positioned below the custom shortcut edit
button.
Fix that by moving the remove button to the header bar.
[1]
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/keyboard/keyboard-wires.png
https://bugzilla.gnome.org/show_bug.cgi?id=777846
panels/keyboard/cc-keyboard-shortcut-editor.c | 3 +-
panels/keyboard/shortcut-editor.ui | 28 ++++++++++--------------
2 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index c09686c..efb2bc8 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -319,6 +319,7 @@ set_header_mode (CcKeyboardShortcutEditor *self,
mode != HEADER_MODE_CUSTOM_EDIT);
gtk_widget_set_visible (self->replace_button, mode == HEADER_MODE_REPLACE);
gtk_widget_set_visible (self->set_button, mode == HEADER_MODE_SET);
+ gtk_widget_set_visible (self->remove_button, mode == HEADER_MODE_CUSTOM_EDIT);
/* By setting the default response, the action button gets the 'suggested-action' applied */
switch (mode)
@@ -643,7 +644,6 @@ setup_keyboard_item (CcKeyboardShortcutEditor *self,
is_accel_empty ? "button" : "label");
gtk_widget_set_visible (self->reset_custom_button, !is_accel_empty);
- gtk_widget_show (self->remove_button);
g_signal_handlers_unblock_by_func (self->command_entry, command_entry_changed_cb, self);
g_signal_handlers_unblock_by_func (self->name_entry, name_entry_changed_cb, self);
@@ -1040,6 +1040,5 @@ cc_keyboard_shortcut_editor_set_mode (CcKeyboardShortcutEditor *self,
gtk_widget_set_sensitive (self->add_button, FALSE);
gtk_widget_hide (self->reset_custom_button);
- gtk_widget_hide (self->remove_button);
}
}
diff --git a/panels/keyboard/shortcut-editor.ui b/panels/keyboard/shortcut-editor.ui
index 4cd4558..90100e7 100644
--- a/panels/keyboard/shortcut-editor.ui
+++ b/panels/keyboard/shortcut-editor.ui
@@ -280,22 +280,6 @@
<property name="top_attach">2</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="remove_button">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Remove</property>
- <property name="valign">end</property>
- <signal name="clicked" handler="remove_button_clicked_cb"
object="CcKeyboardShortcutEditor" swapped="yes" />
- <style>
- <class name="destructive-action" />
- </style>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
</object>
<packing>
<property name="name">custom</property>
@@ -365,6 +349,18 @@
</object>
</child>
<child>
+ <object class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Remove</property>
+ <property name="valign">end</property>
+ <signal name="clicked" handler="remove_button_clicked_cb" object="CcKeyboardShortcutEditor"
swapped="yes" />
+ <style>
+ <class name="destructive-action" />
+ </style>
+ </object>
+ </child>
+ <child>
<object class="GtkButton" id="add_button">
<property name="label" translatable="yes">Add</property>
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]