summaryrefslogtreecommitdiff
path: root/gtk/gtklistbox.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-11-05 13:48:02 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-11-05 13:48:02 -0500
commit4f29b4a348cdf6cdc322c5b7396f8c6adce91432 (patch)
tree0baed2ebb143276b0059b30e540690a9ea52190c /gtk/gtklistbox.c
parent92a5eccc3deddaf0772b839c18c54c74b54f1ff1 (diff)
downloadgtk+-4f29b4a348cdf6cdc322c5b7396f8c6adce91432.tar.gz
listbox: Add element names
The names used here are list and row.
Diffstat (limited to 'gtk/gtklistbox.c')
-rw-r--r--gtk/gtklistbox.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index c5ca895ed7..bff3f32918 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -60,6 +60,12 @@
* as selected when the user tries to select it.
*
* The GtkListBox widget was added in GTK+ 3.10.
+ *
+ * # CSS nodes
+ *
+ * GtkListBox uses a single CSS node with name list. GtkListBoxRow uses
+ * a single CSS node with name row. The row nodes get the .activatable
+ * style class added when appropriate.
*/
typedef struct
@@ -296,7 +302,6 @@ gtk_list_box_init (GtkListBox *box)
{
GtkListBoxPrivate *priv = BOX_PRIV (box);
GtkWidget *widget = GTK_WIDGET (box);
- GtkStyleContext *context;
gtk_widget_set_has_window (widget, TRUE);
gtk_widget_set_redraw_on_allocate (widget, TRUE);
@@ -306,9 +311,6 @@ gtk_list_box_init (GtkListBox *box)
priv->children = g_sequence_new (NULL);
priv->header_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_LIST);
-
priv->multipress_gesture = gtk_gesture_multi_press_new (widget);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture),
GTK_PHASE_BUBBLE);
@@ -616,6 +618,8 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
"select-all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"unselect-all", 0);
+
+ gtk_widget_class_set_css_name (widget_class, "list");
}
/**
@@ -3022,7 +3026,6 @@ gtk_list_box_row_init (GtkListBoxRow *row)
ROW_PRIV (row)->selectable = TRUE;
context = gtk_widget_get_style_context (GTK_WIDGET (row));
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_LIST_ROW);
gtk_style_context_add_class (context, "activatable");
}
@@ -3678,6 +3681,7 @@ gtk_list_box_row_class_init (GtkListBoxRowClass *klass)
g_object_class_install_properties (object_class, LAST_ROW_PROPERTY, row_properties);
+ gtk_widget_class_set_css_name (widget_class, "row");
}
static void