[gnome-software] Separate EggListBox entries
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Separate EggListBox entries
- Date: Tue, 29 Jan 2013 15:38:18 +0000 (UTC)
commit 5e857d8e811161a39f3839c9d13d2695a0e3662f
Author: Florian Brosch <flo brosch gmail com>
Date: Sun Jan 27 20:43:30 2013 +0100
Separate EggListBox entries
Signed-off-by: Richard Hughes <richard hughsie com>
src/gs-main.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-main.c b/src/gs-main.c
index b6d8a03..ddeed79 100644
--- a/src/gs-main.c
+++ b/src/gs-main.c
@@ -1136,6 +1136,28 @@ gs_main_utf8_filter_helper (const gchar *haystack, const gchar *needle_utf8)
}
/**
+ * gs_main_egg_list_separator_func
+ **/
+static void
+gs_main_egg_list_separator_func (GtkWidget **separator,
+ GtkWidget *child,
+ GtkWidget *before,
+ gpointer user_data)
+{
+ /* first entry */
+ if (before == NULL) {
+ g_clear_object (separator);
+ return;
+ }
+
+ if (*separator != NULL)
+ return;
+
+ *separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ g_object_ref_sink (*separator);
+}
+
+/**
* gs_main_installed_filter_func:
**/
static gboolean
@@ -1268,6 +1290,10 @@ gs_main_startup_cb (GApplication *application, GsMainPrivate *priv)
/* setup installed */
priv->list_box_installed = egg_list_box_new ();
+ egg_list_box_set_separator_funcs (priv->list_box_installed,
+ gs_main_egg_list_separator_func,
+ priv,
+ NULL);
egg_list_box_set_filter_func (priv->list_box_installed,
gs_main_installed_filter_func,
priv,
@@ -1285,6 +1311,10 @@ gs_main_startup_cb (GApplication *application, GsMainPrivate *priv)
/* setup updates */
priv->list_box_updates = egg_list_box_new ();
+ egg_list_box_set_separator_funcs (priv->list_box_updates,
+ gs_main_egg_list_separator_func,
+ priv,
+ NULL);
egg_list_box_set_selection_mode (priv->list_box_updates,
GTK_SELECTION_NONE);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_updates"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]