fix cursor and fontpreview when theme is an absolute path.

SVN revision: 72308
This commit is contained in:
Gustavo Sverzut Barbieri 2012-06-17 18:03:33 +00:00
parent 7f0c9cdc47
commit 03e58cbad2
3 changed files with 17 additions and 23 deletions

View File

@ -207,14 +207,21 @@ elm_main(int argc, char **argv)
if (theme) if (theme)
{ {
char path[PATH_MAX];
char name[PATH_MAX];
if (eina_str_has_suffix(theme, ".edj")) if (eina_str_has_suffix(theme, ".edj"))
eina_stringshare_replace(&(config->theme), theme); eina_strlcpy(name, theme, sizeof(name));
else else
{ snprintf(name, sizeof(name), "%s.edj", theme);
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s.edj", theme); if (strchr(name, '/'))
eina_stringshare_replace(&(config->theme), buf); eina_strlcpy(path, name, sizeof(path));
} else
snprintf(path, sizeof(path), "%s/themes/%s",
elm_app_data_dir_get(), name);
eina_stringshare_replace(&(config->theme), path);
config_tmp = EINA_TRUE; config_tmp = EINA_TRUE;
} }
@ -250,15 +257,7 @@ elm_main(int argc, char **argv)
bg = o = edje_object_add(evas_object_evas_get(win)); bg = o = edje_object_add(evas_object_evas_get(win));
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
if (strchr(config->theme, '/')) edje_object_file_set(o, config->theme, "terminology/background");
edje_object_file_set(o, config->theme, "terminology/background");
else
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/themes/%s",
elm_app_data_dir_get(), config->theme);
edje_object_file_set(o, buf, "terminology/background");
}
elm_win_resize_object_add(win, o); elm_win_resize_object_add(win, o);
evas_object_show(o); evas_object_show(o);

View File

@ -120,12 +120,9 @@ _cb_op_font_content_get(void *data, Evas_Object *obj, const char *part)
(!strcmp(part, "elm.swallow.end"))) (!strcmp(part, "elm.swallow.end")))
{ {
Evas_Object *o; Evas_Object *o;
char buf[4096];
o = edje_object_add(evas_object_evas_get(obj)); o = edje_object_add(evas_object_evas_get(obj));
snprintf(buf, sizeof(buf), "%s/themes/%s", edje_object_file_set(o, config->theme, "terminology/fontpreview");
elm_app_data_dir_get(), config->theme);
edje_object_file_set(o, buf, "terminology/fontpreview");
evas_object_size_hint_min_set(o, evas_object_size_hint_min_set(o,
40 * elm_config_scale_get(), 40 * elm_config_scale_get(),
40 * elm_config_scale_get()); 40 * elm_config_scale_get());

View File

@ -720,9 +720,7 @@ _smart_add(Evas_Object *obj)
evas_object_propagate_events_set(o, EINA_FALSE); evas_object_propagate_events_set(o, EINA_FALSE);
evas_object_smart_member_add(o, obj); evas_object_smart_member_add(o, obj);
sd->cur.obj = o; sd->cur.obj = o;
snprintf(buf, sizeof(buf), "%s/themes/%s", edje_object_file_set(o, config->theme, "terminology/cursor");
elm_app_data_dir_get(), config->theme);
edje_object_file_set(o, buf, "terminology/cursor");
evas_object_resize(o, sd->font.chw, sd->font.chh); evas_object_resize(o, sd->font.chw, sd->font.chh);
evas_object_show(o); evas_object_show(o);