X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=3a29431e965f7b2cb1d71aa338d4c02d1d55a8fc;hb=406c6ab4dfbef3ace867dbe2ffd54072e4e48113;hp=0424147f0c828f9a120a5610ab20e72c0d2b4b0d;hpb=1161f02260cfbb6a22a6d9de91bb31e27f16cc88;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 0424147..3a29431 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -270,6 +270,22 @@ SetWidgetFont (GtkWidget *w, char **s) } void +ApplyFont (Option *opt, char *font) +{ + GtkWidget *w = NULL; + if(!font && opt->font) font = *opt->font; + if(!font) return; + switch(opt->type) { + case ListBox: + case Label: w = opt->handle; break; + case Button: if(opt->handle) w = gtk_bin_get_child(GTK_BIN(opt->handle)); break; + case TextBox: w = opt->textValue; if(!w) w = opt->handle; break; + default: ; + } + if(w && font) SetWidgetFont(w, &font); +} + +void SetListBoxItem (GtkListStore *store, int n, char *msg) { GtkTreeIter iter; @@ -599,6 +615,11 @@ AppendColorized (Option *opt, char *s, int count) static GtkTextIter end; static GtkTextTag *fgTags[8], *bgTags[8], *font, *bold, *normal, *attr = NULL; + if(!s) { + font = NULL; + return; + } + if(!font) { font = gtk_text_buffer_create_tag(opt->handle, NULL, "font", appData.icsFont, NULL); gtk_widget_modify_base(GTK_WIDGET(opt->textValue), GTK_STATE_NORMAL, &backgroundColor);