]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-cell-renderer-text.c
Updated Oriya Translation
[empathy.git] / libempathy-gtk / empathy-cell-renderer-text.c
index d48de32b820e56abc7189d1b0cebf867a8804fda..e3dd27d30cc861a1aececc434253792036e5b0a4 100644 (file)
@@ -14,9 +14,9 @@
  *
  * You should have received a copy of the GNU General Public
  * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- * 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
  * Authors: Mikael Hallendal <micke@imendio.com>
  */
 
 
 #include <string.h>
 
+#include <libempathy/empathy-utils.h>
 #include "empathy-cell-renderer-text.h"
 
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CELL_RENDERER_TEXT, EmpathyCellRendererTextPriv))
-
-struct _EmpathyCellRendererTextPriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCellRendererText)
+typedef struct {
        gchar    *name;
        gchar    *status;
        gboolean  is_group;
@@ -37,10 +37,8 @@ struct _EmpathyCellRendererTextPriv {
        gboolean  is_selected;
 
        gboolean  show_status;
-};
+} EmpathyCellRendererTextPriv;
 
-static void empathy_cell_renderer_text_class_init (EmpathyCellRendererTextClass *klass);
-static void empathy_cell_renderer_text_init       (EmpathyCellRendererText      *cell);
 static void cell_renderer_text_finalize          (GObject                     *object);
 static void cell_renderer_text_get_property      (GObject                     *object,
                                                  guint                        param_id,
@@ -131,10 +129,10 @@ empathy_cell_renderer_text_class_init (EmpathyCellRendererTextClass *klass)
 static void
 empathy_cell_renderer_text_init (EmpathyCellRendererText *cell)
 {
-       EmpathyCellRendererTextPriv *priv;
-
-       priv = GET_PRIV (cell);
+       EmpathyCellRendererTextPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (cell,
+               EMPATHY_TYPE_CELL_RENDERER_TEXT, EmpathyCellRendererTextPriv);
 
+       cell->priv = priv;
        g_object_set (cell,
                      "ellipsize", PANGO_ELLIPSIZE_END,
                      NULL);
@@ -288,7 +286,7 @@ cell_renderer_text_update_text (EmpathyCellRendererText *cell,
 {
        EmpathyCellRendererTextPriv *priv;
        PangoAttrList              *attr_list;
-       PangoAttribute             *attr_color, *attr_style, *attr_size;
+       PangoAttribute             *attr_color, *attr_size;
        GtkStyle                   *style;
        gchar                      *str;
 
@@ -317,10 +315,10 @@ cell_renderer_text_update_text (EmpathyCellRendererText *cell,
 
        attr_list = pango_attr_list_new ();
 
-       attr_style = pango_attr_style_new (PANGO_STYLE_ITALIC);
-       attr_style->start_index = strlen (priv->name) + 1;
-       attr_style->end_index = -1;
-       pango_attr_list_insert (attr_list, attr_style);
+       attr_size = pango_attr_size_new (pango_font_description_get_size (style->font_desc) / 1.2);
+       attr_size->start_index = strlen (priv->name) + 1;
+       attr_size->end_index = -1;
+       pango_attr_list_insert (attr_list, attr_size);
 
        if (!selected) {
                GdkColor color;
@@ -328,17 +326,11 @@ cell_renderer_text_update_text (EmpathyCellRendererText *cell,
                color = style->text_aa[GTK_STATE_NORMAL];
 
                attr_color = pango_attr_foreground_new (color.red, color.green, color.blue);
-               attr_color->start_index = attr_style->start_index;
+               attr_color->start_index = attr_size->start_index;
                attr_color->end_index = -1;
                pango_attr_list_insert (attr_list, attr_color);
        }
 
-       attr_size = pango_attr_size_new (pango_font_description_get_size (style->font_desc) / 1.2);
-
-       attr_size->start_index = attr_style->start_index;
-       attr_size->end_index = -1;
-       pango_attr_list_insert (attr_list, attr_size);
-
        if (!priv->status || !priv->status[0] || !priv->show_status) {
                str = g_strdup (priv->name);
        } else {