I#1966 - EColorSchemeWatcher: Verify chosen dark variant theme name exists

Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1966
This commit is contained in:
Milan Crha
2022-07-20 18:01:46 +02:00
parent f0df67904c
commit 677d5ec7a3
+7
View File
@@ -215,6 +215,13 @@ e_color_scheme_watcher_sync_theme (EColorSchemeWatcher *self)
if (self->color_scheme == E_COLOR_SCHEME_PREFER_DARK &&
e_color_scheme_watcher_check_theme_exists (theme_name, "dark")) {
new_theme_name = g_strconcat (theme_name, "-dark", NULL);
/* Verify whether the newly constructed name can be used; otherwise the theme
supports the dark variant with the original name. */
if (!e_color_scheme_watcher_check_theme_exists (new_theme_name, NULL)) {
g_free (new_theme_name);
new_theme_name = theme_name;
theme_name = NULL;
}
} else if (suffix_cut && e_color_scheme_watcher_check_theme_exists (theme_name, NULL)) {
new_theme_name = theme_name;
theme_name = NULL;