inspector: Do not accidentally change tab in the object notebook

The "hide-and-show" dance makes the notebook select the next tab.

https://bugzilla.gnome.org/show_bug.cgi?id=733092
This commit is contained in:
Stefano Facchini 2014-07-12 14:59:59 +02:00 committed by Matthias Clasen
parent 66428bdd70
commit cef6f34fb7
3 changed files with 25 additions and 16 deletions

View File

@ -235,7 +235,6 @@ cleanup_context (GtkInspectorClassesList *cl)
gtk_list_store_clear (cl->priv->model);
cl->priv->context = NULL;
gtk_widget_hide (GTK_WIDGET (cl));
}
static void
@ -245,6 +244,7 @@ remove_dead_object (gpointer data, GObject *dead_object)
cl->priv->context = NULL;
cleanup_context (cl);
gtk_widget_hide (GTK_WIDGET (cl));
}
void
@ -258,7 +258,10 @@ gtk_inspector_classes_list_set_object (GtkInspectorClassesList *cl,
cleanup_context (cl);
if (!GTK_IS_WIDGET (object))
return;
{
gtk_widget_hide (GTK_WIDGET (cl));
return;
}
gtk_widget_show (GTK_WIDGET (cl));

View File

@ -271,19 +271,21 @@ gtk_inspector_size_groups_set_object (GtkInspectorSizeGroups *sl,
GObject *object)
{
clear_view (sl);
gtk_widget_hide (GTK_WIDGET (sl));
if (GTK_IS_WIDGET (object))
if (!GTK_IS_WIDGET (object))
{
GSList *groups, *l;
gtk_widget_hide (GTK_WIDGET (sl));
return;
}
gtk_widget_show (GTK_WIDGET (sl));
groups = _gtk_widget_get_sizegroups (GTK_WIDGET (object));
for (l = groups; l; l = l->next)
{
GtkSizeGroup *group = l->data;
add_size_group (sl, group);
}
GSList *groups, *l;
gtk_widget_show (GTK_WIDGET (sl));
groups = _gtk_widget_get_sizegroups (GTK_WIDGET (object));
for (l = groups; l; l = l->next)
{
GtkSizeGroup *group = l->data;
add_size_group (sl, group);
}
}

View File

@ -308,10 +308,11 @@ void
gtk_inspector_style_prop_list_set_object (GtkInspectorStylePropList *self,
GObject *object)
{
gtk_widget_hide (GTK_WIDGET (self));
if (self->priv->widget == (GtkWidget *)object)
return;
{
gtk_widget_hide (GTK_WIDGET (self));
return;
}
if (self->priv->widget)
{
@ -321,7 +322,10 @@ gtk_inspector_style_prop_list_set_object (GtkInspectorStylePropList *self,
}
if (!GTK_IS_WIDGET (object))
return;
{
gtk_widget_hide (GTK_WIDGET (self));
return;
}
self->priv->widget = (GtkWidget *)object;
g_object_weak_ref (G_OBJECT (self), disconnect_each_other, object);