{ 13, R2R|T2T|SAME_ROW, 200, NULL, (void*) &CCB, NULL, NULL, Label, "Black" }, // black clock
{ 50, RR|TT|SAME_ROW, 100, NULL, (void*) &LogoB, NULL, NULL, Skip, "" }, // black logo
{ 0, LR|T2T|BORDER, 401, NULL, NULL, "", NULL, Skip, "2" }, // backup for title in window (if no room for other)
-{ 0, LR|T2T|BORDER, 270, NULL, NULL, "", NULL, Label, "message" }, // message field
+{ 0, LR|T2T|BORDER, 270, NULL, NULL, (char*)&appData.font, NULL, Label, "message" }, // message field
{ 0, RR|TT|SAME_ROW, 125, NULL, NULL, "", NULL, BoxBegin, "" }, // (optional) button bar
- { 0, 0, 0, NULL, (void*) &ToStartEvent, NULL, NULL, Button, N_("<<") },
- { 0, SAME_ROW, 0, NULL, (void*) &BackwardEvent, NULL, NULL, Button, N_("<") },
- { 0, SAME_ROW, 0, NULL, (void*) &PauseEvent, NULL, NULL, Button, N_(PAUSE_BUTTON) },
- { 0, SAME_ROW, 0, NULL, (void*) &ForwardEvent, NULL, NULL, Button, N_(">") },
- { 0, SAME_ROW, 0, NULL, (void*) &ToEndEvent, NULL, NULL, Button, N_(">>") },
+ { 0, 0, 0, NULL, (void*) &ToStartEvent, (char*)&appData.font, NULL, Button, N_("<<") },
+ { 0, SAME_ROW, 0, NULL, (void*) &BackwardEvent, (char*)&appData.font, NULL, Button, N_("<") },
+ { 0, SAME_ROW, 0, NULL, (void*) &PauseEvent, (char*)&appData.font, NULL, Button, N_(PAUSE_BUTTON) },
+ { 0, SAME_ROW, 0, NULL, (void*) &ForwardEvent, (char*)&appData.font, NULL, Button, N_(">") },
+ { 0, SAME_ROW, 0, NULL, (void*) &ToEndEvent, (char*)&appData.font, NULL, Button, N_(">>") },
{ 0, 0, 0, NULL, NULL, "", NULL, BoxEnd, "" },
{ 401, LR|TB, 401, NULL, (char*) &Exp, NULL, NULL, Graph, "shadow board" }, // board
{ 2, COMBO_CALLBACK, 0, NULL, (void*) &PMSelect, NULL, pieceMenuStrings[0], PopUp, "menuW" },
gtk_window_set_title(GTK_WINDOW(shells[dlg]), title);
}
+int
+SetWidgetFont (GtkWidget *w, char *s)
+{
+ PangoFontDescription *pfd;
+ if (!s || !*s || *s == '#') return 0; // no spec, empty spec or spec of color: fail
+ pfd = pango_font_description_from_string(*(char**)s);
+ gtk_widget_modify_font(w, pfd);
+ return 1;
+}
+
void
SetListBoxItem (GtkListStore *store, int n, char *msg)
{
void
AddHandler (Option *opt, DialogClass dlg, int nr)
{
- PangoFontDescription *pfd;
switch(nr) {
case 0: // history (now uses generic textview callback)
case 1: // comment (likewise)
g_signal_connect(opt->handle, "key-press-event", G_CALLBACK (TypeInProc), (gpointer) (dlg<<16 | (opt - dialogOptions[dlg])));
break;
case 5: // game list
- pfd = pango_font_description_from_string(appData.gameListFont);
- gtk_widget_modify_font(opt->handle, pfd);
+ SetWidgetFont(opt->handle, (char*) &appData.gameListFont);
g_signal_connect(opt->handle, "button-press-event", G_CALLBACK (GameListEvent), (gpointer) 0 );
case 4: // game-list filter
g_signal_connect(opt->handle, "key-press-event", G_CALLBACK (GameListEvent), (gpointer) (intptr_t) nr );
/* no label so let textview occupy all columns */
Pack(hbox, table, sw, left, left+r, top, GTK_EXPAND);
}
- if ( option[i].textValue != NULL ) {
- PangoFontDescription *pfd;
- pfd = pango_font_description_from_string(*(char**)option[i].textValue);
- gtk_widget_modify_font(textview, pfd);
- }
+ SetWidgetFont(textview, option[i].textValue);
if ( *(char**)option[i].target != NULL )
gtk_text_buffer_set_text (textbuffer, *(char**)option[i].target, -1);
else
option[i].handle = (void *) (label = gtk_label_new(option[i].name));
/* Left Justify */
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ SetWidgetFont(label, option[i].textValue);
if(option[i].min & BORDER) {
GtkWidget *frame = gtk_frame_new(NULL);
gtk_container_add(GTK_CONTAINER(frame), label);
}
/* set button color on new variant dialog */
+ if(!SetWidgetFont(gtk_bin_get_child(GTK_BIN(button)), option[i].textValue))
if(option[i].textValue) {
gdk_color_parse( option[i].textValue, &color );
gtk_widget_modify_bg ( GTK_WIDGET(button), GTK_STATE_NORMAL, &color );