2005-02-03 [paul] 1.0.0cvs25.3
[claws.git] / src / headerview.c
index 495c72254b699df3ced9274b1f82cff096619569..9d24146418832c3fc6ced882db3b641e1c9e7156 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
 #include <gtk/gtkhbox.h>
 #include <gtk/gtkvbox.h>
 #include <gtk/gtklabel.h>
-#include <gtk/gtkpixmap.h>
+#include <gtk/gtkimage.h>
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
 #endif
 
 #include "intl.h"
-#include "main.h"
 #include "headerview.h"
 #include "prefs_common.h"
+#include "codeconv.h"
 #include "gtkutils.h"
 #include "utils.h"
 
-static GdkFont *boldfont;
-
 #define TR(str)        (prefs_common.trans_hdr ? gettext(str) : str)
 
 #if 0
@@ -133,23 +131,19 @@ HeaderView *headerview_create(void)
 
 void headerview_init(HeaderView *headerview)
 {
-       if (!boldfont)
-               boldfont = gdk_fontset_load(BOLD_FONT);
-
-#define SET_FONT_STYLE(wid) \
-{ \
-       GtkStyle *style; \
- \
-       style = gtk_style_copy(gtk_widget_get_style(headerview->wid)); \
-       if (boldfont) \
-               style->font = boldfont; \
-       gtk_widget_set_style(headerview->wid, style); \
-}
+       static PangoFontDescription *boldfont = NULL;
 
-       SET_FONT_STYLE(from_header_label);
-       SET_FONT_STYLE(to_header_label);
-       SET_FONT_STYLE(ng_header_label);
-       SET_FONT_STYLE(subject_header_label);
+       if (!boldfont) {
+               boldfont = pango_font_description_from_string(BOLD_FONT);
+               pango_font_description_set_weight(boldfont, PANGO_WEIGHT_BOLD);
+       }
+
+       if (boldfont) {
+               gtk_widget_modify_font(headerview->from_header_label, boldfont);
+               gtk_widget_modify_font(headerview->to_header_label, boldfont);
+               gtk_widget_modify_font(headerview->ng_header_label, boldfont);
+               gtk_widget_modify_font(headerview->subject_header_label, boldfont);
+       }
 
        headerview_clear(headerview);
        headerview_set_visibility(headerview, prefs_common.display_header_pane);
@@ -228,16 +222,16 @@ static void headerview_show_xface(HeaderView *headerview, MsgInfo *msginfo)
        if (!headerview->image) {
                GtkWidget *image;
 
-               image = gtk_pixmap_new(pixmap, mask);
+               image = gtk_image_new_from_pixmap(pixmap, mask);
                gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
                gtk_widget_show(image);
                headerview->image = image;
        } else {
-               gtk_pixmap_set(GTK_PIXMAP(headerview->image), pixmap, mask);
+               gtk_image_set_from_pixmap(GTK_IMAGE(headerview->image), pixmap, mask);
                gtk_widget_show(headerview->image);
        }
 
-       gdk_pixmap_unref(pixmap);
+       g_object_unref(pixmap);
 }
 #endif