summaryrefslogtreecommitdiffstats
path: root/src/gui/Ephraim.vala
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-06-23 20:37:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-06-23 20:37:31 +0200
commitd5adf274c137bef22d5695d4a280e10068edcb0e (patch)
tree6c01a10c06a1fabe40d8a6498b8a934df781a023 /src/gui/Ephraim.vala
parent04a0f989a71a83114fe1f58b2ebe1af2f56cb87b (diff)
downloadephraim-d5adf274c137bef22d5695d4a280e10068edcb0e.tar
ephraim-d5adf274c137bef22d5695d4a280e10068edcb0e.zip
Show avatars in roster
Diffstat (limited to 'src/gui/Ephraim.vala')
-rw-r--r--src/gui/Ephraim.vala24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/Ephraim.vala b/src/gui/Ephraim.vala
index 6474482..5130247 100644
--- a/src/gui/Ephraim.vala
+++ b/src/gui/Ephraim.vala
@@ -25,13 +25,14 @@ public class Ephraim {
rosterView.set_model(roster);
rosterView.query_tooltip.connect((x, y, keyboard_tip, tooltip) => {
+ Gtk.TreeModel model;
Gtk.TreeIter iter;
- if(!rosterView.get_tooltip_context(out x, out y, keyboard_tip, null, null, out iter))
+ if(!rosterView.get_tooltip_context(out x, out y, keyboard_tip, out model, null, out iter))
return false;
Value value;
- roster.get_value(iter, 0, out value);
+ model.get_value(iter, 0, out value);
Contact? c = value.get_object() as Contact;
if(c == null)
@@ -42,14 +43,27 @@ public class Ephraim {
if(r == null)
return false;
- tooltip.set_text("Resource: " + r.key);
+ tooltip.set_text("Resource: " + r.key + " (" + r.value.priority.to_string() + ")");
return true;
});
rosterView.has_tooltip = true;
- rosterView.append_column(new Gtk.TreeViewColumn.with_attributes("Presence", new CellRendererPresence(), "contact", 0, null));
- rosterView.append_column(new Gtk.TreeViewColumn.with_attributes("Contact", new CellRendererContact(), "contact", 0, null));
+ Gtk.TreeViewColumn presenceColumn = new Gtk.TreeViewColumn.with_attributes(null, new CellRendererPresence(), "contact", 0, null);
+ presenceColumn.min_width = 32;
+ rosterView.append_column(presenceColumn);
+
+ Gtk.TreeViewColumn contactColumn = new Gtk.TreeViewColumn();
+
+ Gtk.CellRenderer cellRendererContact = new CellRendererContact();
+ contactColumn.pack_start(cellRendererContact, true);
+ contactColumn.set_attributes(cellRendererContact, "contact", 0, null);
+
+ Gtk.CellRenderer cellRendererAvatar = new CellRendererAvatar();
+ contactColumn.pack_end(cellRendererAvatar, false);
+ contactColumn.set_attributes(cellRendererAvatar, "contact", 0, null);
+
+ rosterView.append_column(contactColumn);
window.visible = true;