[ekiga] Roster: Fixed roster displaying only one line of info.



commit d7238451a251d85be98df3500986b3d3c64a8ddc
Author: Damien Sandras <dsandras beip be>
Date:   Thu Mar 28 17:25:53 2013 +0100

    Roster: Fixed roster displaying only one line of info.
    
    This is due to the bitext renderer not able to display different heights
    for different cells anymore.

 lib/engine/gui/gtk-frontend/roster-view-gtk.cpp |   14 +++++++++++++-
 lib/gui/gm-cell-renderer-bitext.c               |    2 ++
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
index f262561..d6fe9b5 100644
--- a/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
+++ b/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
@@ -1024,6 +1024,7 @@ on_presentity_added (RosterViewGtk* self,
   bool active = false;
   bool away = false;
   guint timeout = 0;
+  std::string status;
   gchar *old_presence = NULL;
   gboolean should_emit = FALSE;
 
@@ -1081,13 +1082,24 @@ on_presentity_added (RosterViewGtk* self,
                             -1);
       }
     }
+    status = presentity->get_status ();
+    if (status.empty ()) {
+      if (presentity->get_presence () == "away")
+        status = _("Away");
+      else if (presentity->get_presence () == "available")
+        status = _("Available");
+      else if (presentity->get_presence () == "offline")
+        status = _("Offline");
+      else if (presentity->get_presence () == "busy")
+        status = _("Busy");
+    }
     gtk_tree_store_set (self->priv->store, &iter,
                         COLUMN_TYPE, TYPE_PRESENTITY,
                         COLUMN_OFFLINE, active,
                         COLUMN_HEAP, heap.get (),
                         COLUMN_PRESENTITY, presentity.get (),
                         COLUMN_NAME, presentity->get_name ().c_str (),
-                        COLUMN_STATUS, presentity->get_status ().c_str (),
+                        COLUMN_STATUS, status.c_str (),
                         COLUMN_PRESENCE, presentity->get_presence ().c_str (),
                         COLUMN_ACTIVE, (!active || away) ? "gray" : "black", -1);
     gtk_tree_model_get (GTK_TREE_MODEL (self->priv->store), &iter,
diff --git a/lib/gui/gm-cell-renderer-bitext.c b/lib/gui/gm-cell-renderer-bitext.c
index d176d39..9ed4197 100644
--- a/lib/gui/gm-cell-renderer-bitext.c
+++ b/lib/gui/gm-cell-renderer-bitext.c
@@ -252,6 +252,8 @@ gm_cell_renderer_bitext_init (GmCellRendererBitext* self)
                                            GmCellRendererBitextPrivate);
   self->priv->primary_text = g_strdup ("");
   self->priv->secondary_text = g_strdup ("");
+
+  gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (self), 2);
 }
 
 static void


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