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



commit e009d59f8b77a627509b4ffe8f49f51f663f3c21
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 749e7f0..eda8cc2 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]