From 5a7a427e189eb15ca761eb7d3c8d22bad67e233f Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 4 Jun 2012 12:43:57 +0200 Subject: fixed and simplified handling of default config values they must be set after loading a keyfile since when setting them before they are overwritten when a keyfile can be loaded even if they don't exist in the keyfile --- .../gtk-experiment-transcript-formats.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/gtk-experiment-widgets') diff --git a/lib/gtk-experiment-widgets/gtk-experiment-transcript-formats.c b/lib/gtk-experiment-widgets/gtk-experiment-transcript-formats.c index 3317f73..3898e30 100644 --- a/lib/gtk-experiment-widgets/gtk-experiment-transcript-formats.c +++ b/lib/gtk-experiment-widgets/gtk-experiment-transcript-formats.c @@ -216,6 +216,7 @@ gtk_experiment_transcript_set_interactive_format(GtkExperimentTranscript *trans, default_attribs = pango_attr_list_new(); +#ifdef DEFAULT_INTERACTIVE_FORMAT_FONT font = pango_font_description_from_string(DEFAULT_INTERACTIVE_FORMAT_FONT); if (font != NULL) { attrib = pango_attr_font_desc_new(font); @@ -223,24 +224,25 @@ gtk_experiment_transcript_set_interactive_format(GtkExperimentTranscript *trans, pango_attr_list_insert(default_attribs, attrib); pango_font_description_free(font); } - - if (DEFAULT_INTERACTIVE_FORMAT_FGCOLOR != NULL && - pango_color_parse(&color, DEFAULT_INTERACTIVE_FORMAT_FGCOLOR)) { +#endif +#ifdef DEFAULT_INTERACTIVE_FORMAT_FGCOLOR + if (pango_color_parse(&color, DEFAULT_INTERACTIVE_FORMAT_FGCOLOR)) { attrib = pango_attr_foreground_new(color.red, color.green, color.blue); attrib->end_index = 1; pango_attr_list_insert(default_attribs, attrib); } - - if (DEFAULT_INTERACTIVE_FORMAT_BGCOLOR != NULL && - pango_color_parse(&color, DEFAULT_INTERACTIVE_FORMAT_BGCOLOR)) { +#endif +#ifdef DEFAULT_INTERACTIVE_FORMAT_BGCOLOR + if (pango_color_parse(&color, DEFAULT_INTERACTIVE_FORMAT_BGCOLOR)) { attrib = pango_attr_background_new(color.red, color.green, color.blue); attrib->end_index = 1; pango_attr_list_insert(default_attribs, attrib); } +#endif } gtk_experiment_transcript_free_format(fmt); -- cgit v1.2.3