[gtk/list-widget-styles: 3/3] list widgets: Document css structure



commit 51c6ce1734cbd782b64ad1e79829850e17d520b7
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 4 10:05:17 2020 -0400

    list widgets: Document css structure
    
    We didn't fill in this expected part of the widget
    documentation yet.

 gtk/gtkcolumnview.c | 25 +++++++++++++++++++++++++
 gtk/gtkgridview.c   | 16 ++++++++++++++++
 gtk/gtklistview.c   | 18 ++++++++++++++++++
 3 files changed, 59 insertions(+)
---
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index 950f467f5b..707336c262 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -55,6 +55,31 @@
  * must be attached to a sort model for the data that the view is showing, and the
  * columns must have sorters attached to them by calling gtk_column_view_column_set_sorter().
  * The initial sort order can be set with gtk_column_view_sort_by_column().
+ *
+ * # CSS nodes
+ *
+ * |[<!-- language="plain" -->
+ * columnview[.column-separators]
+ * ├── header
+ * │   ├── <column header>
+ * ┊   ┊
+ * │   ╰── <column header>
+ * │
+ * ├── listview
+ * │
+ * ┊
+ * ╰── [rubberband]
+
+ * ]|
+ *
+ * GtkColumnView uses a single CSS node named columnview. It may carry the
+ * .column-separators style class, when #GtkColumnView:show-column-separators
+ * property is set. Header widets appear below a node with name header.
+ * The rows are contained in a GtkListView widget, so there is a listview
+ * node with the same structure as for a standalone GtkListView widget. If
+ * #GtkColumnView:show-row-separators is set, it will be passed on to the
+ * list view, causing its CSS node to carry the .separators style class.
+ * For rubberband selection, a node with name rubberband is used.
  */
 
 struct _GtkColumnView
diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c
index d16357a17b..855ee7a0fa 100644
--- a/gtk/gtkgridview.c
+++ b/gtk/gtkgridview.c
@@ -48,6 +48,22 @@
  * @see_also: #GListModel
  *
  * GtkGridView is a widget to present a view into a large dynamic grid of items.
+ *
+ * # CSS nodes
+ *
+ * |[<!-- language="plain" -->
+ * gridview
+ * ├── child
+ * │
+ * ├── child
+ * │
+ * ┊
+ * ╰── [rubberband]
+ * ]|
+ *
+ * GtkGridView uses a single CSS node with name gridview. Each child
+ * uses a single CSS node with name child. For rubberband selection,
+ * a subnode with name rubberband is used.
  */
 
 typedef struct _Cell Cell;
diff --git a/gtk/gtklistview.c b/gtk/gtklistview.c
index 8688472e0a..5f043e591a 100644
--- a/gtk/gtklistview.c
+++ b/gtk/gtklistview.c
@@ -46,6 +46,24 @@
  * @see_also: #GListModel
  *
  * GtkListView is a widget to present a view into a large dynamic list of items.
+ *
+ * # CSS nodes
+ *
+ * |[<!-- language="plain" -->
+ * listview[.separators]
+ * ├── row
+ * │
+ * ├── row
+ * │
+ * ┊
+ * ╰── [rubberband]
+
+ * ]|
+ *
+ * GtkListView uses a single CSS node named listview. It may carry the
+ * .separators style class, when #GtkListView:show-separators property
+ * is set. Each child widget uses a single CSS node named row. For
+ * rubberband selection, a node with name rubberband is used.
  */
 
 typedef struct _ListRow ListRow;


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