diff options
author | rbuj <[email protected]> | 2021-11-09 00:20:54 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-03-23 05:06:44 +0000 |
commit | 92a53187074aa64dde8982da78e98a5d69e1a9e0 (patch) | |
tree | 13b0287f8c09272626502ef182b4b5ecef5e7b03 /src | |
parent | 394bb344739e947cfde70a487358728fb4ca26a2 (diff) | |
download | mate-terminal-92a53187074aa64dde8982da78e98a5d69e1a9e0.tar.bz2 mate-terminal-92a53187074aa64dde8982da78e98a5d69e1a9e0.tar.xz |
terminal-profile: fix initialization for default colors
Diffstat (limited to 'src')
-rw-r--r-- | src/terminal-profile.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/src/terminal-profile.c b/src/terminal-profile.c index b991105..d40ff85 100644 --- a/src/terminal-profile.c +++ b/src/terminal-profile.c @@ -520,26 +520,38 @@ terminal_profile_reset_property_internal (TerminalProfile *profile, /* A few properties don't have defaults via the param spec; set them explicitly */ switch (pspec->param_id) { - case PROP_FOREGROUND_COLOR: - case PROP_BOLD_COLOR: - g_value_set_boxed (value, &DEFAULT_FOREGROUND_COLOR); - break; + case PROP_FOREGROUND_COLOR: + case PROP_BOLD_COLOR: + { + GdkRGBA color; - case PROP_BACKGROUND_COLOR: - g_value_set_boxed (value, &DEFAULT_BACKGROUND_COLOR); - break; + if (!gdk_rgba_parse (&color, DEFAULT_FOREGROUND_COLOR)) + return; + color.alpha = 1.0; + g_value_set_boxed (value, &color); + break; + } + case PROP_BACKGROUND_COLOR: + { + GdkRGBA color; - case PROP_FONT: - g_value_take_boxed (value, pango_font_description_from_string (DEFAULT_FONT)); - break; + if (!gdk_rgba_parse (&color, DEFAULT_BACKGROUND_COLOR)) + return; + color.alpha = 1.0; + g_value_set_boxed (value, &color); + break; + } + case PROP_FONT: + g_value_take_boxed (value, pango_font_description_from_string (DEFAULT_FONT)); + break; - case PROP_PALETTE: - set_value_from_palette (value, DEFAULT_PALETTE, TERMINAL_PALETTE_SIZE); - break; + case PROP_PALETTE: + set_value_from_palette (value, DEFAULT_PALETTE, TERMINAL_PALETTE_SIZE); + break; - default: - g_param_value_set_default (pspec, value); - break; + default: + g_param_value_set_default (pspec, value); + break; } if (notify) |