inital gtk2 patch
[claws.git] / src / headerview.c
index 4d9c6359dfdd8282aefab896063bf64fc6f86e2f..8941bf5c7236844b1788824b6153cac974d991ec 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;
+PangoFontDescription *boldfont;
 
 #define TR(str)        (prefs_common.trans_hdr ? gettext(str) : str)
 
@@ -133,17 +133,14 @@ HeaderView *headerview_create(void)
 
 void headerview_init(HeaderView *headerview)
 {
-       if (!boldfont)
-               boldfont = gtkut_font_load(BOLD_FONT);
+       if (!boldfont && BOLD_FONT)
+               boldfont = pango_font_description_from_string
+                               (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); \
+               gtk_widget_modify_font(headerview->wid, boldfont); \
 }
 
        SET_FONT_STYLE(from_header_label);
@@ -228,12 +225,12 @@ 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);
        }