inspector: Hide the inspector tab when empty
This commit is contained in:
@ -177,15 +177,17 @@ void
|
||||
gtk_inspector_gestures_set_object (GtkInspectorGestures *sl,
|
||||
GObject *object)
|
||||
{
|
||||
clear_all (sl);
|
||||
|
||||
if (GTK_IS_WIDGET (object))
|
||||
{
|
||||
GHashTable *hash;
|
||||
GHashTableIter iter;
|
||||
GList *list, *l;
|
||||
gint phase;
|
||||
|
||||
clear_all (sl);
|
||||
gtk_widget_hide (GTK_WIDGET (sl));
|
||||
|
||||
if (!GTK_IS_WIDGET (object))
|
||||
return;
|
||||
|
||||
hash = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
for (phase = GTK_PHASE_NONE; phase <= GTK_PHASE_TARGET; phase++)
|
||||
{
|
||||
@ -195,6 +197,9 @@ gtk_inspector_gestures_set_object (GtkInspectorGestures *sl,
|
||||
g_list_free (list);
|
||||
}
|
||||
|
||||
if (g_hash_table_size (hash))
|
||||
gtk_widget_show (GTK_WIDGET (sl));
|
||||
|
||||
while (g_hash_table_size (hash) > 0)
|
||||
{
|
||||
gpointer key, value;
|
||||
@ -206,11 +211,6 @@ gtk_inspector_gestures_set_object (GtkInspectorGestures *sl,
|
||||
}
|
||||
|
||||
g_hash_table_unref (hash);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (sl));
|
||||
}
|
||||
else
|
||||
gtk_widget_hide (GTK_WIDGET (sl));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user