widget-factory: Show proper separators

This commit is contained in:
Benjamin Otte 2019-06-04 01:45:17 +02:00
parent 836635d1ae
commit 098f182d8f
2 changed files with 1 additions and 17 deletions

View File

@ -523,22 +523,6 @@ on_range_to_changed (GtkSpinButton *to)
gtk_spin_button_set_value (from, v2); gtk_spin_button_set_value (from, v2);
} }
static void
update_header (GtkListBoxRow *row,
GtkListBoxRow *before,
gpointer data)
{
if (before != NULL &&
gtk_list_box_row_get_header (row) == NULL)
{
GtkWidget *separator;
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (separator);
gtk_list_box_row_set_header (row, separator);
}
}
static void static void
info_bar_response (GtkWidget *infobar, gint response_id) info_bar_response (GtkWidget *infobar, gint response_id)
{ {
@ -1731,7 +1715,6 @@ activate (GApplication *app)
g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget); g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox"); widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox");
gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_header, NULL, NULL);
g_signal_connect (widget, "row-activated", G_CALLBACK (row_activated), NULL); g_signal_connect (widget, "row-activated", G_CALLBACK (row_activated), NULL);
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "listboxrow1switch"); widget2 = (GtkWidget *)gtk_builder_get_object (builder, "listboxrow1switch");

View File

@ -1620,6 +1620,7 @@ microphone-sensitivity-medium-symbolic</property>
<child> <child>
<object class="GtkListBox" id="listbox"> <object class="GtkListBox" id="listbox">
<property name="selection-mode">none</property> <property name="selection-mode">none</property>
<property name="show-separators">1</property>
<child type="placeholder"> <child type="placeholder">
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">No rows found</property> <property name="label">No rows found</property>