forked from enlightenment/terminology
theme: add theme_path_default_get()
This commit is contained in:
parent
886bce509f
commit
458f9a6da6
|
@ -111,7 +111,7 @@ options_theme_preview_add(Evas_Object *parent,
|
||||||
oe = elm_layout_edje_get(o);
|
oe = elm_layout_edje_get(o);
|
||||||
obg = oe;
|
obg = oe;
|
||||||
if (!edje_object_file_set(oe, file, "terminology/background"))
|
if (!edje_object_file_set(oe, file, "terminology/background"))
|
||||||
theme_apply_default(oe, config, "terminology/background");
|
edje_object_file_set(oe, theme_path_default_get(), "terminology/background");
|
||||||
if (config->translucent)
|
if (config->translucent)
|
||||||
edje_object_signal_emit(oe, "translucent,on", "terminology");
|
edje_object_signal_emit(oe, "translucent,on", "terminology");
|
||||||
else
|
else
|
||||||
|
@ -133,7 +133,7 @@ options_theme_preview_add(Evas_Object *parent,
|
||||||
o = elm_layout_add(parent);
|
o = elm_layout_add(parent);
|
||||||
oe = elm_layout_edje_get(o);
|
oe = elm_layout_edje_get(o);
|
||||||
if (!edje_object_file_set(oe, file, "terminology/core"))
|
if (!edje_object_file_set(oe, file, "terminology/core"))
|
||||||
theme_apply_default(oe, config, "terminology/core");
|
edje_object_file_set(oe, theme_path_default_get(), "terminology/core");
|
||||||
if (config->translucent)
|
if (config->translucent)
|
||||||
edje_object_signal_emit(oe, "translucent,on", "terminology");
|
edje_object_signal_emit(oe, "translucent,on", "terminology");
|
||||||
else
|
else
|
||||||
|
@ -209,7 +209,7 @@ options_theme_preview_add(Evas_Object *parent,
|
||||||
o = elm_layout_add(parent);
|
o = elm_layout_add(parent);
|
||||||
oe = elm_layout_edje_get(o);
|
oe = elm_layout_edje_get(o);
|
||||||
if (!edje_object_file_set(oe, file, "terminology/cursor"))
|
if (!edje_object_file_set(oe, file, "terminology/cursor"))
|
||||||
theme_apply_default(oe, config, "terminology/cursor");
|
edje_object_file_set(oe, theme_path_default_get(), "terminology/cursor");
|
||||||
edje_object_signal_emit(oe, "focus,in", "terminology");
|
edje_object_signal_emit(oe, "focus,in", "terminology");
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
evas_object_data_set(oo, "cursor", o);
|
evas_object_data_set(oo, "cursor", o);
|
||||||
|
@ -219,7 +219,7 @@ options_theme_preview_add(Evas_Object *parent,
|
||||||
o = edje_object_add(evas);
|
o = edje_object_add(evas);
|
||||||
oe = o;
|
oe = o;
|
||||||
if (!edje_object_file_set(oe, file, "terminology/selection"))
|
if (!edje_object_file_set(oe, file, "terminology/selection"))
|
||||||
theme_apply_default(oe, config, "terminology/selection");
|
edje_object_file_set(oe, theme_path_default_get(), "terminology/selection");
|
||||||
edje_object_signal_emit(oe, "focus,in", "terminology");
|
edje_object_signal_emit(oe, "focus,in", "terminology");
|
||||||
edje_object_signal_emit(oe, "mode,oneline", "terminology");
|
edje_object_signal_emit(oe, "mode,oneline", "terminology");
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
|
|
|
@ -41,8 +41,8 @@ config_theme_path_get(const Config *config)
|
||||||
return theme_path_get(config->theme);
|
return theme_path_get(config->theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
const char *
|
||||||
_theme_path_default_get(void)
|
theme_path_default_get(void)
|
||||||
{
|
{
|
||||||
static char path[PATH_MAX] = "";
|
static char path[PATH_MAX] = "";
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ theme_apply(Evas_Object *edje, const Config *config, const char *group)
|
||||||
config_theme_path_get(config), group, errmsg);
|
config_theme_path_get(config), group, errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edje_object_file_set(edje, _theme_path_default_get(), group))
|
if (edje_object_file_set(edje, theme_path_default_get(), group))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
||||||
|
@ -110,7 +110,7 @@ theme_apply_elm(Evas_Object *layout, const Config *config, const char *group)
|
||||||
INF(_("Could not find theme: file=%s group=%s error='%s', trying default theme"),
|
INF(_("Could not find theme: file=%s group=%s error='%s', trying default theme"),
|
||||||
config_theme_path_get(config), group, errmsg);
|
config_theme_path_get(config), group, errmsg);
|
||||||
|
|
||||||
if (elm_layout_file_set(layout, _theme_path_default_get(), group))
|
if (elm_layout_file_set(layout, theme_path_default_get(), group))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
||||||
|
@ -122,23 +122,6 @@ done:
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
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, _theme_path_default_get(), group))
|
|
||||||
return EINA_TRUE;
|
|
||||||
|
|
||||||
errmsg = edje_load_error_str(edje_object_load_error_get(edje));
|
|
||||||
ERR(_("Could not load default theme for group=%s: %s"), group, errmsg);
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
theme_reload(Evas_Object *edje)
|
theme_reload(Evas_Object *edje)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
|
|
||||||
Eina_Bool theme_apply(Evas_Object *edje, const Config *config, const char *group);
|
Eina_Bool theme_apply(Evas_Object *edje, const Config *config, const char *group);
|
||||||
Eina_Bool theme_apply_elm(Evas_Object *edje, const Config *config, const char *group);
|
Eina_Bool theme_apply_elm(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_reload(Evas_Object *edje);
|
||||||
void theme_auto_reload_enable(Evas_Object *edje);
|
void theme_auto_reload_enable(Evas_Object *edje);
|
||||||
const char *theme_path_get(const char *name);
|
const char *theme_path_get(const char *name);
|
||||||
|
const char *theme_path_default_get(void);
|
||||||
|
|
||||||
Eina_Bool utils_need_scale_wizard(void);
|
Eina_Bool utils_need_scale_wizard(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue