[gtk+] viewport: Add an element name to the css node



commit b6dbfc791f56c9f5b9999b8bef6ea670221ba903
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 29 07:47:31 2015 -0400

    viewport: Add an element name to the css node
    
    This lets us avoid hardcoding the type in CSS.

 gtk/gtkviewport.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index f885292..6b8ac24 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -45,7 +45,7 @@
  *
  * The #GtkViewport widget acts as an adaptor class, implementing
  * scrollability for child widgets that lack their own scrolling
- * capabilities. Use #GtkViewport to scroll child widgets such as
+ * capabilities. Use GtkViewport to scroll child widgets such as
  * #GtkGrid, #GtkBox, and so on.
  *
  * If a widget has native scrolling abilities, such as #GtkTextView,
@@ -56,8 +56,12 @@
  * implement #GtkScrollable is added to a #GtkScrolledWindow, so you can
  * ignore the presence of the viewport.
  *
- * The #GtkViewport will start scrolling content only if allocated less
+ * The GtkViewport will start scrolling content only if allocated less
  * than the child widget’s minimum size in a given orientation.
+ *
+ * # CSS nodes
+ *
+ * GtkViewport has a single CSS node with name viewport.
  */
 
 struct _GtkViewportPrivate
@@ -179,6 +183,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
                                                      GTK_TYPE_SHADOW_TYPE,
                                                      GTK_SHADOW_IN,
                                                      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
+  gtk_widget_class_set_css_name (widget_class, "viewport");
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]