summaryrefslogtreecommitdiffstats
path: root/src/gui/CellRendererContact.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/CellRendererContact.vala')
-rw-r--r--src/gui/CellRendererContact.vala22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/CellRendererContact.vala b/src/gui/CellRendererContact.vala
index 924b601..26497ec 100644
--- a/src/gui/CellRendererContact.vala
+++ b/src/gui/CellRendererContact.vala
@@ -38,14 +38,23 @@ public class CellRendererContact : Gtk.CellRenderer {
Gee.Map.Entry<string, Contact.Resource> res = contact.get_resource_with_highest_priority();
if(res != null && res.value.status != null) {
- str += "\n<span size=\"small\" fgcolor=\"grey40\" style=\"italic\">" + Markup.escape_text(res.value.status) + "</span>";
+ string status = res.value.status;
+ if(status.chr(-1, '\n') != null) {
+ status = status.split("\n", 2)[0] + "...";
+ }
+ str += "\n<span size=\"small\" fgcolor=\"grey40\" style=\"italic\">" + Markup.escape_text(status) + "</span>";
}
textRenderer.markup = str;
Gee.Map.Entry<string, Contact.Resource>? r = contact.get_resource_with_highest_priority();
if(r == null) {
- presenceRenderer.pixbuf = offline;
+ if(contact.subscription.is_to()) {
+ presenceRenderer.pixbuf = offline;
+ }
+ else {
+ presenceRenderer.pixbuf = undefined;
+ }
}
else {
switch(r.value.show) {
@@ -68,9 +77,13 @@ public class CellRendererContact : Gtk.CellRenderer {
}
avatarRenderer.pixbuf = contact.avatar;
+
+ cell_background = "#fff";
}
else if(_data is String) {
- textRenderer.text = (_data as String).data;
+ textRenderer.markup = "<i>" + Markup.escape_text((_data as String).data) + "</i>";
+
+ cell_background = "#ddd";
}
}
}
@@ -96,8 +109,6 @@ public class CellRendererContact : Gtk.CellRenderer {
height = calc_height;
if(cell_area != null) {
- if(&width != null)
- width = cell_area.width;
if(&x_offset != null)
x_offset = 0;
if(&y_offset != null)
@@ -162,5 +173,6 @@ public class CellRendererContact : Gtk.CellRenderer {
Object();
textRenderer.ellipsize = Pango.EllipsizeMode.END;
+ cell_background_set = true;
}
}