From a416458ca91625f7c44ab25822f78ff8bc3354d9 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 22 Nov 2020 20:42:58 +0100 Subject: [PATCH] options_theme: ensure the selected theme is the right one was not the case when explicitly setting them from command line --- src/bin/options_theme.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/bin/options_theme.c b/src/bin/options_theme.c index 5cdd77e2..6741264d 100644 --- a/src/bin/options_theme.c +++ b/src/bin/options_theme.c @@ -143,6 +143,7 @@ options_theme(Evas_Object *opbox, Evas_Object *term) Config *config = termio_config_get(term); Eina_Bool to_skip = EINA_FALSE; double scale = elm_config_scale_get(); + const char *config_theme_name = ""; Theme_Ctx *ctx; ctx = calloc(1, sizeof(*ctx)); @@ -151,6 +152,15 @@ options_theme(Evas_Object *opbox, Evas_Object *term) ctx->config = config; ctx->term = term; + if (config && config->theme) + { + config_theme_name = strrchr(config->theme, '/'); + if (config_theme_name) + config_theme_name++; + else + config_theme_name = config->theme; + } + fr = o = elm_frame_add(opbox); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -236,9 +246,7 @@ options_theme(Evas_Object *opbox, Evas_Object *term) _cb_op_theme_sel, t); if (t->item) { - ctx->themes = eina_list_append(ctx->themes, t); - if ((config) && (config->theme) && - (!strcmp(config->theme, t->name))) + if (!strcmp(config_theme_name, t->name)) { if (ctx->seltimer) ecore_timer_del(ctx->seltimer);