[gnome-calendar/calendar-management] sources-dialog: add separator at each row
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-management] sources-dialog: add separator at each row
- Date: Thu, 15 Jan 2015 20:40:26 +0000 (UTC)
commit 6445abb0e50e90703dcef6925feff9f0cb3a5997
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 15 06:54:25 2015 -0200
sources-dialog: add separator at each row
src/gcal-source-manager-dialog.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-source-manager-dialog.c b/src/gcal-source-manager-dialog.c
index 94d57ae..0023789 100644
--- a/src/gcal-source-manager-dialog.c
+++ b/src/gcal-source-manager-dialog.c
@@ -42,6 +42,10 @@ enum {
};
/* callbacks */
+static void display_header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data);
+
static void source_added_cb (GcalManager *manager,
ESource *source,
gboolean enabled,
@@ -71,6 +75,28 @@ static void gcal_source_manager_dialog_set_property (GObject *o
G_DEFINE_TYPE_WITH_PRIVATE (GcalSourceManagerDialog, gcal_source_manager_dialog, GTK_TYPE_DIALOG)
/**
+ * display_header_func:
+ *
+ * Shows a separator before each row.
+ *
+ */
+static void
+display_header_func (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer user_data)
+{
+ if (before != NULL)
+ {
+ GtkWidget *header;
+
+ header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_show (header);
+
+ gtk_list_box_row_set_header (row, header);
+ }
+}
+
+/**
* source_added_cb:
*
* Callback for when an #ESource is added
@@ -260,6 +286,9 @@ gcal_source_manager_dialog_constructed (GObject *object)
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (priv->add_button), sourcesmenu);
g_object_unref (builder);
+
+ /* add separators to the listbox */
+ gtk_list_box_set_header_func (GTK_LIST_BOX (priv->sources_listbox), display_header_func, NULL, NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]