options_theme: ensure the selected theme is the right one

was not the case when explicitly setting them from command line
This commit is contained in:
Boris Faure 2020-11-22 20:42:58 +01:00
parent 2669cc5780
commit a416458ca9
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
1 changed files with 11 additions and 3 deletions

View File

@ -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);