[ease/sourceview] Added support for number displayed to right of SourceItem.



commit fc49b87c3e7b725a7a7993e2f4d404dd2f7e6fbd
Author: Nate Stedman <natesm gmail com>
Date:   Sat Jun 12 14:01:11 2010 -0400

    Added support for number displayed to right of SourceItem.
    
    - The "notification" property sets this value.
    - It is invisible at value 0.

 src/Main.vala        |    2 ++
 src/SourceGroup.vala |    2 +-
 src/SourceList.vala  |   11 ++++++++++-
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/Main.vala b/src/Main.vala
index 145d407..6e0fce6 100644
--- a/src/Main.vala
+++ b/src/Main.vala
@@ -256,6 +256,7 @@ public static class Ease.Main : GLib.Object
 		text = new Gtk.TextView();
 		item = new Source.Item.from_stock("gtk-undo", text);
 		group.add_item(item);
+		item.notification = 20;
 		text = new Gtk.TextView();
 		item = new Source.Item.from_stock("gtk-redo", text);
 		group.add_item(item);
@@ -265,6 +266,7 @@ public static class Ease.Main : GLib.Object
 		text = new Gtk.TextView();
 		item = new Source.Item.from_stock("gtk-add", text);
 		group.add_item(item);
+		item.notification = 5;
 		text = new Gtk.TextView();
 		item = new Source.Item.from_stock("gtk-about", text);
 		group.add_item(item);
diff --git a/src/SourceGroup.vala b/src/SourceGroup.vala
index 94673b0..472909d 100644
--- a/src/SourceGroup.vala
+++ b/src/SourceGroup.vala
@@ -85,7 +85,7 @@ public class Source.Group : Gtk.Alignment
 		// create subwidgets
 		all_box = new Gtk.VBox(false, 0);
 		items_box = new Gtk.VBox(true, ITEM_PADDING);
-		var items_align = new Gtk.Alignment(0, 0, 0, 0);
+		var items_align = new Gtk.Alignment(0, 0, 1, 0);
 		items_align.set_padding(ITEMS_PADDING_TOP,
 		                        ITEMS_PADDING_BOTTOM,
 		                        ITEMS_PADDING_LEFT,
diff --git a/src/SourceList.vala b/src/SourceList.vala
index 31530b1..34c38a3 100644
--- a/src/SourceList.vala
+++ b/src/SourceList.vala
@@ -63,6 +63,11 @@ public class Source.List : Gtk.Alignment
 	private const Gtk.PolicyType V_POLICY = Gtk.PolicyType.AUTOMATIC;
 	
 	/**
+	 * Padding around the Source.List
+	 */
+	public const int PADDING = 5;
+	
+	/**
 	 * Emitted when a { link Source.Item} in this Source.List is clicked.
 	 *
 	 * @param sender The Source.Item that was clicked.
@@ -79,16 +84,20 @@ public class Source.List : Gtk.Alignment
 		// create widgets
 		scroll = new Gtk.ScrolledWindow(null, null);
 		box = new Gtk.VBox(false, 0);
+		var viewport = new Gtk.Viewport(null, null);
 		
 		// set properties
 		bin = linked_bin;
 		scroll.shadow_type = SHADOW;
+		viewport.shadow_type = SHADOW;
 		scroll.hscrollbar_policy = H_POLICY;
 		scroll.vscrollbar_policy = V_POLICY;
 		set(0, 0, 1, 1);
+		set_padding(PADDING, PADDING, PADDING, PADDING);
 		
 		// assemble
-		scroll.add_with_viewport(box);
+		viewport.add(box);
+		scroll.add(viewport);
 		add(scroll);
 	}
 	



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