Commit cef6f34f authored by Stefano Facchini's avatar Stefano Facchini Committed by Matthias Clasen

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
parent 66428bdd
......@@ -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));
......
......@@ -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_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);
}
gtk_widget_hide (GTK_WIDGET (sl));
return;
}
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);
}
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment