After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731911 - Add GtkListBox header code helper
Add GtkListBox header code helper
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.12.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 732050
Blocks:
 
 
Reported: 2014-06-19 13:33 UTC by Bastien Nocera
Modified: 2015-06-21 01:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2014-06-19 13:33:36 UTC
This piece of code is copied 19 times in gnome-control-center:
static void 
cc_color_panel_header_func (GtkListBoxRow  *row,
                            GtkListBoxRow  *before,
                            gpointer    user_data)
{
  GtkWidget *current;

  if (before == NULL)
    return;

  current = gtk_list_box_row_get_header (row);
  if (current == NULL)
    {    
      current = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
      gtk_widget_show (current);
      gtk_list_box_row_set_header (row, current);
    }    
}

We should have this piece of code in GTK+ instead.
Comment 1 Matthias Clasen 2014-06-19 19:45:28 UTC
The inofficial plan for separators in listboxes is to use css. It almost works now, with something like

.list-row {
  border-width: 1px;
  border-color: red;
  border-style: solid;
}

The missing piece is :first-child/:last-child support so we can avoid extraneous or missing separators at the top/bottom.
Comment 2 Matthias Clasen 2015-06-21 01:36:02 UTC
first-/last-child support is in place now.