diff --git a/gtk/inspector/variant-editor.c b/gtk/inspector/variant-editor.c index e81131256b..52c99f05ce 100644 --- a/gtk/inspector/variant-editor.c +++ b/gtk/inspector/variant-editor.c @@ -21,7 +21,7 @@ #include "variant-editor.h" #include "gtksizegroup.h" -#include "gtktogglebutton.h" +#include "gtkcheckbutton.h" #include "gtkentry.h" #include "gtklabel.h" #include "gtkbox.h" @@ -102,7 +102,7 @@ ensure_editor (GtkInspectorVariantEditor *self, if (self->editor) gtk_widget_unparent (self->editor); - self->editor = gtk_toggle_button_new_with_label ("FALSE"); + self->editor = gtk_check_button_new (); g_signal_connect (self->editor, "notify::active", G_CALLBACK (variant_editor_changed_cb), self); @@ -175,18 +175,14 @@ gtk_inspector_variant_editor_set_value (GtkWidget *editor, ensure_editor (self, g_variant_get_type (value)); - g_signal_handlers_block_by_func (self->editor, variant_editor_changed_cb, self->data); + g_signal_handlers_block_by_func (self->editor, variant_editor_changed_cb, self); if (g_variant_type_equal (self->type, G_VARIANT_TYPE_BOOLEAN)) { - GtkToggleButton *tb = GTK_TOGGLE_BUTTON (self->editor); + GtkCheckButton *b = GTK_CHECK_BUTTON (self->editor); - if (gtk_toggle_button_get_active (tb) != g_variant_get_boolean (value)) - { - gtk_toggle_button_set_active (tb, g_variant_get_boolean (value)); - gtk_button_set_label (GTK_BUTTON (tb), - g_variant_get_boolean (value) ? "TRUE" : "FALSE"); - } + if (gtk_check_button_get_active (b) != g_variant_get_boolean (value)) + gtk_check_button_set_active (b, g_variant_get_boolean (value)); } else if (g_variant_type_equal (self->type, G_VARIANT_TYPE_STRING)) { @@ -207,7 +203,7 @@ gtk_inspector_variant_editor_set_value (GtkWidget *editor, g_free (text); } - g_signal_handlers_unblock_by_func (self->editor, variant_editor_changed_cb, self->data); + g_signal_handlers_unblock_by_func (self->editor, variant_editor_changed_cb, self); } GVariant * @@ -221,8 +217,8 @@ gtk_inspector_variant_editor_get_value (GtkWidget *editor) if (g_variant_type_equal (self->type, G_VARIANT_TYPE_BOOLEAN)) { - GtkToggleButton *tb = GTK_TOGGLE_BUTTON (self->editor); - value = g_variant_new_boolean (gtk_toggle_button_get_active (tb)); + GtkCheckButton *b = GTK_CHECK_BUTTON (self->editor); + value = g_variant_new_boolean (gtk_check_button_get_active (b)); } else if (g_variant_type_equal (self->type, G_VARIANT_TYPE_STRING)) {