diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-11-04 11:45:10 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-04 12:05:03 -0500 |
commit | cca5cac9656c789036da5bfa93401aa1a815b6a4 (patch) | |
tree | d291d464a5634448e91780aa01be0316ca635f63 /gtk/gtkpaned.c | |
parent | d40576fb3ee748d633f7c3c0a57be5120edc2cff (diff) | |
download | gtk+-cca5cac9656c789036da5bfa93401aa1a815b6a4.tar.gz |
paned: Move .wide to CSS subnode
This fits better with our general use of style classes.
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r-- | gtk/gtkpaned.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index a959c6c9e8..54f0c47690 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -80,11 +80,12 @@ * * |[<!-- language="plain" --> * paned - * ╰── separator + * ╰── separator[.wide] * ]| * * GtkPaned has a main CSS node with name paned, and a subnode for - * the separator with name separator. + * the separator with name separator. The subnodes gets a .wide style + * class when the paned is supposed to be wide. * * ## Creating a paned widget with minimum sizes. * @@ -2936,7 +2937,6 @@ void gtk_paned_set_wide_handle (GtkPaned *paned, gboolean wide) { - GtkStyleContext *context; gboolean old_wide; g_return_if_fail (GTK_IS_PANED (paned)); @@ -2944,11 +2944,10 @@ gtk_paned_set_wide_handle (GtkPaned *paned, old_wide = gtk_paned_get_wide_handle (paned); if (old_wide != wide) { - context = gtk_widget_get_style_context (GTK_WIDGET (paned)); if (wide) - gtk_style_context_add_class (context, GTK_STYLE_CLASS_WIDE); + gtk_css_node_add_class (paned->priv->handle_node, g_quark_from_static_string (GTK_STYLE_CLASS_WIDE)); else - gtk_style_context_remove_class (context, GTK_STYLE_CLASS_WIDE); + gtk_css_node_remove_class (paned->priv->handle_node, g_quark_from_static_string (GTK_STYLE_CLASS_WIDE)); gtk_widget_queue_resize (GTK_WIDGET (paned)); g_object_notify (G_OBJECT (paned), "wide-handle"); @@ -2968,12 +2967,9 @@ gtk_paned_set_wide_handle (GtkPaned *paned, gboolean gtk_paned_get_wide_handle (GtkPaned *paned) { - GtkStyleContext *context; - g_return_val_if_fail (GTK_IS_PANED (paned), FALSE); - - context = gtk_widget_get_style_context (GTK_WIDGET (paned)); - if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_WIDE)) + + if (gtk_css_node_has_class (paned->priv->handle_node, g_quark_from_static_string (GTK_STYLE_CLASS_WIDE))) return TRUE; else return FALSE; |