forked from AuroraMiddleware/gtk
gtk: Reset children styles when changing name
Changing the name of a widget does not just change the current widget's path, but also the path of all its children.
This commit is contained in:
parent
06f590456f
commit
8ce533265e
@ -6920,17 +6920,7 @@ gtk_widget_set_name (GtkWidget *widget,
|
|||||||
g_free (priv->name);
|
g_free (priv->name);
|
||||||
priv->name = new_name;
|
priv->name = new_name;
|
||||||
|
|
||||||
if (priv->path)
|
gtk_widget_reset_style (widget);
|
||||||
{
|
|
||||||
guint pos;
|
|
||||||
|
|
||||||
pos = gtk_widget_path_length (priv->path) - 1;
|
|
||||||
gtk_widget_path_iter_set_name (priv->path, pos,
|
|
||||||
priv->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->context)
|
|
||||||
gtk_style_context_set_path (priv->context, priv->path);
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (widget), "name");
|
g_object_notify (G_OBJECT (widget), "name");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user