mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-07 09:10:11 +00:00
GtkCssProvider: refactor out selector matching.
This commit is contained in:
parent
eec75f1f59
commit
eaddc9f254
@ -472,17 +472,15 @@ struct StylePriorityInfo
|
|||||||
GtkStateType state;
|
GtkStateType state;
|
||||||
};
|
};
|
||||||
|
|
||||||
static GtkStyleSet *
|
static GArray *
|
||||||
gtk_style_get_style (GtkStyleProvider *provider,
|
css_provider_get_selectors (GtkCssProvider *css_provider,
|
||||||
GtkWidgetPath *path)
|
GtkWidgetPath *path)
|
||||||
{
|
{
|
||||||
GtkCssProviderPrivate *priv;
|
GtkCssProviderPrivate *priv;
|
||||||
GtkStyleSet *set;
|
|
||||||
GArray *priority_info;
|
GArray *priority_info;
|
||||||
guint i, j;
|
guint i, j;
|
||||||
|
|
||||||
priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
|
priv = GTK_CSS_PROVIDER_GET_PRIVATE (css_provider);
|
||||||
set = gtk_style_set_new ();
|
|
||||||
priority_info = g_array_new (FALSE, FALSE, sizeof (StylePriorityInfo));
|
priority_info = g_array_new (FALSE, FALSE, sizeof (StylePriorityInfo));
|
||||||
|
|
||||||
for (i = 0; i < priv->selectors_info->len; i++)
|
for (i = 0; i < priv->selectors_info->len; i++)
|
||||||
@ -520,6 +518,23 @@ gtk_style_get_style (GtkStyleProvider *provider,
|
|||||||
g_array_append_val (priority_info, new);
|
g_array_append_val (priority_info, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return priority_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
static GtkStyleSet *
|
||||||
|
gtk_css_provider_get_style (GtkStyleProvider *provider,
|
||||||
|
GtkWidgetPath *path)
|
||||||
|
{
|
||||||
|
GtkCssProviderPrivate *priv;
|
||||||
|
GtkStyleSet *set;
|
||||||
|
GArray *priority_info;
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
|
||||||
|
set = gtk_style_set_new ();
|
||||||
|
|
||||||
|
priority_info = css_provider_get_selectors (GTK_CSS_PROVIDER (provider), path);
|
||||||
|
|
||||||
for (i = 0; i < priority_info->len; i++)
|
for (i = 0; i < priority_info->len; i++)
|
||||||
{
|
{
|
||||||
StylePriorityInfo *info;
|
StylePriorityInfo *info;
|
||||||
|
Loading…
Reference in New Issue
Block a user