[gnome-control-center/gnome-3-8] region: Add separators to the format chooser list



commit 1407140b3af9cf685aeefd8a6109d2062d8a9258
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Mar 7 14:26:54 2013 +0100

    region: Add separators to the format chooser list
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695465

 panels/region/cc-format-chooser.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/panels/region/cc-format-chooser.c b/panels/region/cc-format-chooser.c
index 5a8b41d..381f38a 100644
--- a/panels/region/cc-format-chooser.c
+++ b/panels/region/cc-format-chooser.c
@@ -481,6 +481,22 @@ end_refilter (EggListBox *list_box,
 }
 
 static void
+update_separator_func (GtkWidget **separator,
+                       GtkWidget  *child,
+                       GtkWidget  *before,
+                       gpointer    user_data)
+{
+        if (before == NULL)
+                return;
+
+        if (*separator == NULL) {
+                *separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+                g_object_ref_sink (*separator);
+                gtk_widget_show (*separator);
+        }
+}
+
+static void
 cc_format_chooser_private_free (gpointer data)
 {
         CcFormatChooserPrivate *priv = data;
@@ -536,6 +552,8 @@ cc_format_chooser_new (GtkWidget *parent)
                                       region_visible, chooser, NULL);
         egg_list_box_set_selection_mode (EGG_LIST_BOX (priv->list),
                                          GTK_SELECTION_NONE);
+        egg_list_box_set_separator_funcs (EGG_LIST_BOX (priv->list),
+                                          update_separator_func, NULL, NULL);
 
         add_all_regions (GTK_DIALOG (chooser));
 


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