[gnome-builder/wip/project-selector: 43/72] project-selector: add header func to new dialog



commit 771f96d7fd9a65582b620d19e4a2833b05c4fc87
Author: Christian Hergert <christian hergert me>
Date:   Thu Apr 2 21:48:54 2015 -0700

    project-selector: add header func to new dialog

 src/dialogs/gb-new-project-dialog.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/dialogs/gb-new-project-dialog.c b/src/dialogs/gb-new-project-dialog.c
index 64284cc..e4d5d79 100644
--- a/src/dialogs/gb-new-project-dialog.c
+++ b/src/dialogs/gb-new-project-dialog.c
@@ -211,6 +211,26 @@ gb_new_project_dialog_close (GbNewProjectDialog *self)
 }
 
 static void
+gb_new_project_dialog__open_list_box_header_func (GtkListBoxRow *row,
+                                                  GtkListBoxRow *before,
+                                                  gpointer       user_data)
+{
+  g_assert (GTK_IS_LIST_BOX_ROW (row));
+  g_assert (!before || GTK_IS_LIST_BOX_ROW (before));
+
+  if (before != NULL)
+    {
+      GtkWidget *header;
+
+      header = g_object_new (GTK_TYPE_SEPARATOR,
+                             "orientation", GTK_ORIENTATION_HORIZONTAL,
+                             "visible", TRUE,
+                             NULL);
+      gtk_list_box_row_set_header (row, header);
+    }
+}
+
+static void
 gb_new_project_dialog_finalize (GObject *object)
 {
   GbNewProjectDialog *self = (GbNewProjectDialog *)object;
@@ -364,5 +384,9 @@ gb_new_project_dialog_init (GbNewProjectDialog *self)
                            self,
                            G_CONNECT_SWAPPED);
 
+  gtk_list_box_set_header_func (self->open_list_box,
+                                gb_new_project_dialog__open_list_box_header_func,
+                                NULL, NULL);
+
   g_object_notify (G_OBJECT (self->stack), "visible-child");
 }


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