[gnome-builder/wip/slaf/spellcheck-sidebar: 20/33] spellchecker; fix highlight option initial state



commit 1556ba6d6aa7f82894dff5364f050dc77ce27fc6
Author: Sébastien Lafargue <slafargue gnome org>
Date:   Sat Jan 7 15:43:06 2017 +0100

    spellchecker; fix highlight option initial state
    
    Fix due to the widget hierarchy change (the spellchecker is a
    IdeEditorPerspective descendant now) and the replacement
    of the toggle button by a switch

 libide/editor/ide-editor-spell-widget.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libide/editor/ide-editor-spell-widget.c b/libide/editor/ide-editor-spell-widget.c
index 194c950..f49c8ba 100644
--- a/libide/editor/ide-editor-spell-widget.c
+++ b/libide/editor/ide-editor-spell-widget.c
@@ -464,7 +464,7 @@ static void
 ide_editor_spell__widget_mapped_cb (IdeEditorSpellWidget *self)
 {
   GActionGroup *group = NULL;
-  GtkWidget *widget = GTK_WIDGET (self);
+  GtkWidget *widget = GTK_WIDGET (self->view);
   g_autoptr (GVariant) value = NULL;
 
   g_assert (IDE_IS_EDITOR_SPELL_WIDGET (self));
@@ -475,15 +475,13 @@ ide_editor_spell__widget_mapped_cb (IdeEditorSpellWidget *self)
       widget = gtk_widget_get_parent (widget);
     }
 
-  /* FIXME: we are not a descendant of view anymore */
   if (group != NULL &&
       NULL != (self->view_spellchecking_action = g_action_map_lookup_action (G_ACTION_MAP (group),
                                                                              "spellchecking")))
     {
       value = g_action_get_state (self->view_spellchecking_action);
       self->view_spellchecker_set = g_variant_get_boolean (value);
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->highlight_switch),
-                                    self->view_spellchecker_set);
+      gtk_switch_set_active (GTK_SWITCH (self->highlight_switch), self->view_spellchecker_set);
     }
 
   jump_to_next_misspelled_word (self);


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