blam r622 - trunk/src
- From: cmartin svn gnome org
- To: svn-commits-list gnome org
- Subject: blam r622 - trunk/src
- Date: Wed, 3 Sep 2008 20:31:22 +0000 (UTC)
Author: cmartin
Date: Wed Sep 3 20:31:21 2008
New Revision: 622
URL: http://svn.gnome.org/viewvc/blam?rev=622&view=rev
Log:
Use an icon to indicate the status of entries.
Right now the only difference is between read/unread and the icons are just
some stock items used to test. Good read/unread/new icons will have to be
found.
Modified:
trunk/src/ItemList.cs
Modified: trunk/src/ItemList.cs
==============================================================================
--- trunk/src/ItemList.cs (original)
+++ trunk/src/ItemList.cs Wed Sep 3 20:31:21 2008
@@ -22,7 +22,8 @@
private ItemView itemView;
- private TreeViewColumn titleColumn;
+ private TreeViewColumn titleColumn;
+ private TreeViewColumn iconColumn;
private Item lastItem;
private uint lastTimeout;
@@ -42,6 +43,17 @@
public ItemList(ItemView itemView)
{
this.itemView = itemView;
+
+ CellRendererPixbuf cell2 = new CellRendererPixbuf();
+ iconColumn = new TreeViewColumn();
+ iconColumn.PackStart(cell2, true);
+ iconColumn .Sizing = TreeViewColumnSizing.Autosize;
+ iconColumn.Expand = false;
+ iconColumn.SetCellDataFunc(cell2,
+ new TreeCellDataFunc(IconCellDataFunc));
+
+ AppendColumn(iconColumn);
+
titleColumn = new TreeViewColumn();
CellRendererText cell = new CellRendererText();
@@ -265,6 +277,20 @@
((CellRendererText)cell).Weight = weight;
((CellRendererText)cell).Ellipsize = Pango.EllipsizeMode.End;
}
+
+ private void IconCellDataFunc(TreeViewColumn col,
+ CellRenderer cell,
+ TreeModel model,
+ TreeIter iter)
+ {
+ Item item = model.GetValue(iter, 0) as Imendio.Blam.Item;
+
+ if(item.Unread == true){
+ ((CellRendererPixbuf)cell).StockId = "gtk-file";
+ } else {
+ ((CellRendererPixbuf)cell).StockId = "gtk-find";
+ }
+ }
private void EmitItemSelected (Imendio.Blam.Item item)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]