From 91bf8d7fe262383dbfff84eca9f2314305de3f3d Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Thu, 6 Mar 2003 12:21:10 +0000 Subject: [PATCH 1/1] folderview.c: if configured font can't be loaded fall back to gtk default --- ChangeLog.claws | 8 ++++++++ configure.ac | 2 +- src/folderview.c | 29 ++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 1a75ace7f..c1d42a476 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,11 @@ +2003-03-06 [paul] 0.8.10claws93 + + * src/folderview.c + if configured font can't be loaded fall back to gtk + default. (with thanks to Christoph) + + closes long-standing bug 15 'Crashes on startup' + 2003-03-06 [paul] 0.8.10claws92 * src/compose.c diff --git a/configure.ac b/configure.ac index ad7495344..7bc3d282a 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=10 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws92 +EXTRA_VERSION=claws93 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/folderview.c b/src/folderview.c index 694de7e3d..91210ffb1 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -573,13 +573,28 @@ void folderview_init(FolderView *folderview) gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_NEW,hbox_new); gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_UNREAD,hbox_unread); - - - if (!normalfont) - normalfont = gtkut_font_load(NORMAL_FONT); - if (!boldfont) - boldfont = gtkut_font_load(BOLD_FONT); - + if (!normalfont) { + if (gtkut_font_load(NORMAL_FONT) == NULL) { + GtkStyle *style = gtk_style_new(); + normalfont = style->font; + gdk_font_ref(normalfont); + gtk_style_unref(style); + } + else + normalfont = gtkut_font_load(NORMAL_FONT); + } + + if (!boldfont) { + if (gtkut_font_load(BOLD_FONT) == NULL) { + GtkStyle *style = gtk_style_new(); + boldfont = style->font; + gdk_font_ref(boldfont); + gtk_style_unref(style); + } + else + boldfont = gtkut_font_load(BOLD_FONT); + } + if (!bold_style) { bold_style = gtk_style_copy(gtk_widget_get_style(ctree)); bold_style->font = boldfont; -- 2.25.1