options: theme preview cursor/selection bug fix

Default theme is used for fallback when we apply theme.
But, in the preview, current theme has been used for fallback.

Fixes T1535
This commit is contained in:
Wonguk Jeong 2014-08-13 19:34:57 +02:00
parent 2084fb2aa9
commit 8ba6a73139
3 changed files with 22 additions and 4 deletions

View File

@ -108,7 +108,7 @@ options_theme_preview_add(Evas_Object *parent, Config *config, const char *file,
oe = elm_layout_edje_get(o);
obg = oe;
if (!edje_object_file_set(oe, file, "terminology/background"))
theme_apply(oe, config, "terminology/background");
theme_apply_default(oe, config, "terminology/background");
if (config->translucent)
edje_object_signal_emit(oe, "translucent,on", "terminology");
else
@ -127,7 +127,7 @@ options_theme_preview_add(Evas_Object *parent, Config *config, const char *file,
o = elm_layout_add(parent);
oe = elm_layout_edje_get(o);
if (!edje_object_file_set(oe, file, "terminology/core"))
theme_apply(oe, config, "terminology/core");
theme_apply_default(oe, config, "terminology/core");
if (config->translucent)
edje_object_signal_emit(oe, "translucent,on", "terminology");
else
@ -203,7 +203,7 @@ options_theme_preview_add(Evas_Object *parent, Config *config, const char *file,
o = elm_layout_add(parent);
oe = elm_layout_edje_get(o);
if (!edje_object_file_set(oe, file, "terminology/cursor"))
theme_apply(oe, config, "terminology/cursor");
theme_apply_default(oe, config, "terminology/cursor");
edje_object_signal_emit(oe, "focus,in", "terminology");
evas_object_show(o);
evas_object_data_set(oo, "cursor", o);
@ -213,7 +213,7 @@ options_theme_preview_add(Evas_Object *parent, Config *config, const char *file,
o = edje_object_add(evas);
oe = o;
if (!edje_object_file_set(oe, file, "terminology/selection"))
theme_apply(oe, config, "terminology/selection");
theme_apply_default(oe, config, "terminology/selection");
edje_object_signal_emit(oe, "focus,in", "terminology");
edje_object_signal_emit(oe, "mode,oneline", "terminology");
evas_object_show(o);

View File

@ -51,6 +51,23 @@ theme_apply(Evas_Object *edje, const Config *config, const char *group)
return EINA_FALSE;
}
Eina_Bool
theme_apply_default(Evas_Object *edje, const Config *config, const char *group)
{
const char *errmsg;
EINA_SAFETY_ON_NULL_RETURN_VAL(edje, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(config, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(group, EINA_FALSE);
if (edje_object_file_set(edje, config_theme_path_default_get(config), group))
return EINA_TRUE;
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
ERR(_("Could not load any theme for group=%s: %s"), group, errmsg);
return EINA_FALSE;
}
void
theme_reload(Evas_Object *edje)
{

View File

@ -5,6 +5,7 @@
#include "config.h"
Eina_Bool theme_apply(Evas_Object *edje, const Config *config, const char *group);
Eina_Bool theme_apply_default(Evas_Object *edje, const Config *config, const char *group);
void theme_reload(Evas_Object *edje);
void theme_auto_reload_enable(Evas_Object *edje);
const char *theme_path_get(const char *name);