[gnome-control-center] shortcut-editor: fix headerbar state when adding shortcut



commit 05e03617e15987108bd14c088704d77c85c37b41
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jan 27 11:13:44 2017 -0200

    shortcut-editor: fix headerbar state when adding shortcut
    
    When adding a custom shortcut, the header mode was set to be
    only "Cancel". Per mockups, the "Add" button should also be
    visible but insensitive.
    
    Fix that by correctly setting the header mode on creation mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777824

 panels/keyboard/cc-keyboard-shortcut-editor.c |    2 +-
 panels/keyboard/shortcut-editor.ui            |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index 6dd13bc..315fb63 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -945,7 +945,7 @@ cc_keyboard_shortcut_editor_set_mode (CcKeyboardShortcutEditor *self,
       /* Cleanup whatever was set before */
       clear_custom_entries (self);
 
-      set_header_mode (self, HEADER_MODE_CUSTOM_CANCEL);
+      set_header_mode (self, HEADER_MODE_ADD);
       gtk_header_bar_set_title (GTK_HEADER_BAR (self->headerbar), _("Add Custom Shortcut"));
 
       gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "custom");
diff --git a/panels/keyboard/shortcut-editor.ui b/panels/keyboard/shortcut-editor.ui
index 41bb054..787b829 100644
--- a/panels/keyboard/shortcut-editor.ui
+++ b/panels/keyboard/shortcut-editor.ui
@@ -363,6 +363,7 @@
           <object class="GtkButton" id="add_button">
             <property name="label" translatable="yes">Add</property>
             <property name="visible">True</property>
+            <property name="sensitive">False</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
             <signal name="clicked" handler="add_button_clicked_cb" object="CcKeyboardShortcutEditor" 
swapped="yes" />


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