mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-07 09:10:11 +00:00
GtkStyleContext: allow late set_path() calls.
Now the properties will only be regenerated whenever there's a GtkWidgetPath to query about.
This commit is contained in:
parent
bdadcb568c
commit
fdcda4b356
@ -196,6 +196,7 @@ gtk_style_context_add_provider (GtkStyleContext *context,
|
|||||||
if (!added)
|
if (!added)
|
||||||
priv->providers = g_list_append (priv->providers, new_data);
|
priv->providers = g_list_append (priv->providers, new_data);
|
||||||
|
|
||||||
|
if (priv->widget_path)
|
||||||
rebuild_properties (context);
|
rebuild_properties (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +234,7 @@ gtk_style_context_remove_provider (GtkStyleContext *context,
|
|||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removed)
|
if (removed && priv->widget_path)
|
||||||
rebuild_properties (context);
|
rebuild_properties (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +359,10 @@ gtk_style_context_set_path (GtkStyleContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
|
{
|
||||||
priv->widget_path = gtk_widget_path_copy (path);
|
priv->widget_path = gtk_widget_path_copy (path);
|
||||||
|
rebuild_properties (context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
G_CONST_RETURN GtkWidgetPath *
|
G_CONST_RETURN GtkWidgetPath *
|
||||||
|
Loading…
Reference in New Issue
Block a user