[gitg] Style the list box



commit e05485a9bbae268c8a3158be9406dcd0b245829b
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Oct 20 15:35:18 2012 +0200

    Style the list box

 libgitg-gtk/gitg-gtk-dash-view.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libgitg-gtk/gitg-gtk-dash-view.vala b/libgitg-gtk/gitg-gtk-dash-view.vala
index e05ac6b..be9ebb4 100644
--- a/libgitg-gtk/gitg-gtk-dash-view.vala
+++ b/libgitg-gtk/gitg-gtk-dash-view.vala
@@ -39,6 +39,10 @@ namespace GitgGtk
 		construct
 		{
 			d_listbox = new Egg.ListBox();
+			var context = d_listbox.get_style_context();
+			context.add_class("view");
+			context.add_class("content-view");
+			d_listbox.set_separator_funcs(update_separator);
 			d_listbox.show();
 			add(d_listbox);
 
@@ -64,6 +68,15 @@ namespace GitgGtk
 			}
 		}
 
+		private void update_separator(ref Widget? separator, Widget widget, Widget? before_widget)
+		{
+			if (before_widget != null && separator == null) {
+				separator = new Separator(Orientation.HORIZONTAL);
+			} else {
+				separator = null;
+			}
+		}
+
 		private void add_repository(RecentInfo info)
 		{
 			File info_file = File.new_for_uri(info.get_uri());



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