Skip to content
Snippets Groups Projects
Commit 05603ac8 authored by Adrien Plazas's avatar Adrien Plazas Committed by Guido Gunther
Browse files

examples: Use hdy_list_box_separator_header()

This makes the code simpler.
parent 97213505
No related branches found
No related tags found
1 merge request!176Add many rows widgets
......@@ -26,28 +26,6 @@ struct _ExampleWindow
G_DEFINE_TYPE (ExampleWindow, example_window, GTK_TYPE_APPLICATION_WINDOW)
static void
list_box_separator_header_func (GtkListBoxRow *row,
GtkListBoxRow *before,
gpointer user_data)
{
GtkWidget *header;
if (before == NULL) {
gtk_list_box_row_set_header (row, NULL);
return;
}
header = gtk_list_box_row_get_header (row);
if (header != NULL)
return;
header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (header);
gtk_list_box_row_set_header (row, header);
}
static gboolean
example_window_key_pressed_cb (GtkWidget *sender,
GdkEventKey *event,
......@@ -326,7 +304,7 @@ static void
example_window_init (ExampleWindow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
gtk_list_box_set_header_func (self->column_listbox, list_box_separator_header_func, NULL, NULL);
gtk_list_box_set_header_func (self->column_listbox, hdy_list_box_separator_header, NULL, NULL);
hdy_leaflet_set_visible_child_name (self->content_box, "content");
update_header_bar (self);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment