aboutsummaryrefslogtreecommitdiff
path: root/src/summaryview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-25 08:21:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-25 08:21:20 +0000
commit80ce4c1f69c088289c3c67408c820a03d0b04055 (patch)
tree29890de80367bd066e731075d7be5965b0d43c22 /src/summaryview.c
parentd97b4ce5ed25db02c5488c23bfdfa96ea3f5acd8 (diff)
improved font management.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@39 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/summaryview.c')
-rw-r--r--src/summaryview.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/summaryview.c b/src/summaryview.c
index a67a3496..542a7e3f 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -488,8 +488,9 @@ SummaryView *summary_create(void)
void summary_init(SummaryView *summaryview)
{
- GtkStyle *style;
GtkWidget *pixmap;
+ PangoFontDescription *font_desc;
+ gint size;
gtk_widget_realize(summaryview->ctree);
stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_MARK,
@@ -510,19 +511,10 @@ void summary_init(SummaryView *summaryview)
&clipxpm, &clipxpmmask);
if (!bold_style) {
- PangoFontDescription *font_desc = NULL;
-
bold_style = gtk_style_copy
(gtk_widget_get_style(summaryview->ctree));
- if (prefs_common.boldfont)
- font_desc = pango_font_description_from_string
- (prefs_common.boldfont);
- if (font_desc) {
- if (bold_style->font_desc)
- pango_font_description_free
- (bold_style->font_desc);
- bold_style->font_desc = font_desc;
- }
+ pango_font_description_set_weight
+ (bold_style->font_desc, PANGO_WEIGHT_BOLD);
bold_marked_style = gtk_style_copy(bold_style);
bold_marked_style->fg[GTK_STATE_NORMAL] =
summaryview->color_marked;
@@ -531,23 +523,14 @@ void summary_init(SummaryView *summaryview)
summaryview->color_dim;
}
- style = gtk_style_copy(gtk_widget_get_style
- (summaryview->statlabel_folder));
- if (prefs_common.smallfont) {
- PangoFontDescription *font_desc = NULL;
-
- if (prefs_common.smallfont)
- font_desc = pango_font_description_from_string
- (prefs_common.smallfont);
- if (font_desc) {
- if (style->font_desc)
- pango_font_description_free(style->font_desc);
- style->font_desc = font_desc;
- }
- }
- gtk_widget_set_style(summaryview->statlabel_folder, style);
- gtk_widget_set_style(summaryview->statlabel_select, style);
- gtk_widget_set_style(summaryview->statlabel_msgs, style);
+ font_desc = pango_font_description_new();
+ size = pango_font_description_get_size
+ (summaryview->statlabel_folder->style->font_desc);
+ pango_font_description_set_size(font_desc, size * PANGO_SCALE_SMALL);
+ gtk_widget_modify_font(summaryview->statlabel_folder, font_desc);
+ gtk_widget_modify_font(summaryview->statlabel_select, font_desc);
+ gtk_widget_modify_font(summaryview->statlabel_msgs, font_desc);
+ pango_font_description_free(font_desc);
pixmap = stock_pixmap_widget(summaryview->hbox_l, STOCK_PIXMAP_DIR_OPEN);
gtk_box_pack_start(GTK_BOX(summaryview->hbox_l), pixmap, FALSE, FALSE, 4);