widget: Always set the type on css nodes
See the previous commit for why this is necessary. Also make gtk_widget_class_set_css_name work by looking at the correct class for the name. Note for future reference: GTK_WIDGET_GET_CLASS() does not work in the instance init function.
This commit is contained in:
@ -4366,10 +4366,9 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
|
|||||||
priv->cssnode = gtk_css_widget_node_new (widget);
|
priv->cssnode = gtk_css_widget_node_new (widget);
|
||||||
gtk_css_node_set_state (priv->cssnode, GTK_STATE_FLAG_DIR_LTR);
|
gtk_css_node_set_state (priv->cssnode, GTK_STATE_FLAG_DIR_LTR);
|
||||||
/* need to set correct type here, and only class has the correct type here */
|
/* need to set correct type here, and only class has the correct type here */
|
||||||
if (GTK_WIDGET_GET_CLASS (widget)->priv->css_name)
|
gtk_css_node_set_widget_type (priv->cssnode, G_TYPE_FROM_CLASS (g_class));
|
||||||
gtk_css_node_set_name (priv->cssnode, GTK_WIDGET_GET_CLASS (widget)->priv->css_name);
|
if (GTK_WIDGET_CLASS (g_class)->priv->css_name)
|
||||||
else
|
gtk_css_node_set_name (priv->cssnode, GTK_WIDGET_CLASS (g_class)->priv->css_name);
|
||||||
gtk_css_node_set_widget_type (priv->cssnode, G_TYPE_FROM_CLASS (g_class));
|
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||||
priv->style = gtk_widget_get_default_style ();
|
priv->style = gtk_widget_get_default_style ();
|
||||||
|
Reference in New Issue
Block a user