[gnome-control-center/gnome-3-22] shortcut-editor: untoggle Edit button on cancel



commit 85799aa7223f5237c679b25498cca85baf66dd51
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jan 27 08:23:58 2017 -0200

    shortcut-editor: untoggle Edit button on cancel
    
    When canceling the editing of a custom shortcut, the "Edit" button
    keeps pressed, causing inconsistencies when editing future custom
    events.
    
    To reproduce that:
     - Open a custom shortcut and click "Edit"
     - Start typing the new shortcut; the "Cancel" button will appear
     - *Before* completing the new shortcut, click "Cancel"; the dialog will hide
     - Open a custom shortcut again; the "Edit" button is still toggled
    
    Fix that by properly untoggling the Edit button when cancelling
    the editing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777824

 panels/keyboard/cc-keyboard-shortcut-editor.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-shortcut-editor.c b/panels/keyboard/cc-keyboard-shortcut-editor.c
index cb9e5f6..a99e918 100644
--- a/panels/keyboard/cc-keyboard-shortcut-editor.c
+++ b/panels/keyboard/cc-keyboard-shortcut-editor.c
@@ -549,7 +549,11 @@ setup_keyboard_item (CcKeyboardShortcutEditor *self,
       gtk_entry_set_text (GTK_ENTRY (self->command_entry), item->command);
       gtk_widget_set_sensitive (self->command_entry, item->cmd_editable);
 
+      /* Untoggle the edit button */
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->edit_button), FALSE);
+
       gtk_widget_show (self->remove_button);
+      gtk_widget_show (self->edit_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);


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