elementary: Move icon lookup order to user specified theme.
As discussed on the mailing list we're taming the icon_standard code. This means that icon themes are set by the user not the app. Deprecate all the icon_lookup calls etc and remove the behaviour. Add a config panel to elementary_config where the theme can be selected.
This commit is contained in:
commit
8c02bf5be6
|
@ -1031,6 +1031,14 @@ _cf_themes(void *data,
|
|||
_flip_to(data, "themes");
|
||||
}
|
||||
|
||||
static void
|
||||
_cf_icons(void *data,
|
||||
Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
_flip_to(data, "icons");
|
||||
}
|
||||
|
||||
static void
|
||||
_cf_fonts(void *data,
|
||||
Evas_Object *obj EINA_UNUSED,
|
||||
|
@ -1525,6 +1533,51 @@ _theme_sel(void *data EINA_UNUSED,
|
|||
printf("not implemented\n");
|
||||
}*/
|
||||
|
||||
static void
|
||||
_icon_theme_use(void *data EINA_UNUSED,
|
||||
Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *win = elm_object_top_widget_get(obj);
|
||||
const char *theme = evas_object_data_get(win, "icon_theme");
|
||||
|
||||
elm_config_icon_theme_set(theme);
|
||||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
static void
|
||||
_icon_theme_sel(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
const char *theme = (const char *)data;
|
||||
Evas_Object *win = elm_object_top_widget_get(obj);
|
||||
|
||||
evas_object_data_set(win, "icon_theme", theme);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_icon_theme_valid(const char *theme)
|
||||
{
|
||||
const char *icon_path;
|
||||
|
||||
icon_path = efreet_icon_path_find(theme, "folder", 48);
|
||||
return !!icon_path;
|
||||
}
|
||||
|
||||
static int
|
||||
_icon_theme_list_sort(const void *data1, const void *data2)
|
||||
{
|
||||
const Efreet_Icon_Theme *t1, *t2;
|
||||
|
||||
t1 = data1;
|
||||
t2 = data2;
|
||||
|
||||
if (!t1->name.name) return 1;
|
||||
if (!t2->name.name) return -1;
|
||||
|
||||
return strcmp(t1->name.name, t2->name.name);
|
||||
}
|
||||
|
||||
static void
|
||||
_status_config_sizing(Evas_Object *win,
|
||||
Evas_Object *naviframe)
|
||||
|
@ -2164,6 +2217,112 @@ _status_config_themes(Evas_Object *win,
|
|||
elm_naviframe_item_simple_push(naviframe, tb);
|
||||
}
|
||||
|
||||
static void
|
||||
_status_config_icons(Evas_Object *win,
|
||||
Evas_Object *naviframe)
|
||||
{
|
||||
Evas_Object *tb, *rc, *sp, *li, *ic, *pd, *fr, *bt;
|
||||
Eina_List *list, *l;
|
||||
const Efreet_Icon_Theme *th;
|
||||
Elm_Object_Item *list_it, *def_it;
|
||||
|
||||
tb = elm_table_add(win);
|
||||
evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
||||
rc = evas_object_rectangle_add(evas_object_evas_get(win));
|
||||
evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_min_set(rc, 0, 130);
|
||||
elm_table_pack(tb, rc, 0, 0, 1, 1);
|
||||
|
||||
rc = evas_object_rectangle_add(evas_object_evas_get(win));
|
||||
evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_min_set(rc, 0, 200);
|
||||
elm_table_pack(tb, rc, 0, 1, 1, 1);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
pd = elm_frame_add(win);
|
||||
elm_object_style_set(pd, "pad_medium");
|
||||
evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_table_pack(tb, pd, 0, 0, 1, 1);
|
||||
evas_object_show(pd);
|
||||
|
||||
li = elm_list_add(win);
|
||||
elm_list_multi_select_set(li, EINA_FALSE);
|
||||
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_content_set(pd, li);
|
||||
evas_object_show(li);
|
||||
|
||||
evas_object_data_set(win, "icon_theme", elm_config_icon_theme_get());
|
||||
ic = elm_icon_add(li);
|
||||
def_it = elm_list_item_append(li, "Elementary", ic, NULL, _icon_theme_sel,
|
||||
ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
||||
|
||||
list = efreet_icon_theme_list_get();
|
||||
list = eina_list_sort(list, eina_list_count(list), _icon_theme_list_sort);
|
||||
EINA_LIST_FOREACH(list, l, th)
|
||||
{
|
||||
if (!_icon_theme_valid(th->name.internal))
|
||||
continue;
|
||||
|
||||
ic = elm_icon_add(li);
|
||||
elm_image_file_set(ic, efreet_icon_path_find(th->name.internal, "folder", 48), NULL);
|
||||
list_it = elm_list_item_append(li, th->name.name, ic, NULL,
|
||||
_icon_theme_sel, th->name.internal);
|
||||
|
||||
if (!strcmp(elm_config_icon_theme_get(), th->name.name))
|
||||
elm_list_item_selected_set(list_it, EINA_TRUE);
|
||||
}
|
||||
if (!elm_list_selected_items_get(li))
|
||||
elm_list_item_selected_set(def_it, EINA_TRUE);
|
||||
|
||||
elm_list_go(li);
|
||||
|
||||
pd = elm_frame_add(win);
|
||||
elm_object_style_set(pd, "pad_medium");
|
||||
evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_table_pack(tb, pd, 0, 1, 1, 1);
|
||||
evas_object_show(pd);
|
||||
|
||||
fr = elm_frame_add(win);
|
||||
elm_object_text_set(fr, "Preview");
|
||||
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_content_set(pd, fr);
|
||||
evas_object_show(fr);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
sp = elm_separator_add(win);
|
||||
elm_separator_horizontal_set(sp, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
|
||||
elm_table_pack(tb, sp, 0, 2, 1, 1);
|
||||
evas_object_show(sp);
|
||||
|
||||
pd = elm_frame_add(win);
|
||||
elm_object_style_set(pd, "pad_medium");
|
||||
evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(pd, 0.5, 0.5);
|
||||
elm_table_pack(tb, pd, 0, 3, 1, 1);
|
||||
evas_object_show(pd);
|
||||
|
||||
bt = elm_button_add(win);
|
||||
evas_object_smart_callback_add(bt, "clicked", _icon_theme_use, win);
|
||||
elm_object_text_set(bt, "Use Icon Theme");
|
||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(bt, 0.5, 0.5);
|
||||
elm_object_content_set(pd, bt);
|
||||
evas_object_show(bt);
|
||||
|
||||
evas_object_data_set(win, "icons", tb);
|
||||
elm_naviframe_item_simple_push(naviframe, tb);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_font_preview_update(Evas_Object *win)
|
||||
{
|
||||
|
@ -3941,6 +4100,10 @@ _status_config_full(Evas_Object *win,
|
|||
_cf_themes, win);
|
||||
elm_toolbar_item_priority_set(tb_it, 90);
|
||||
|
||||
tb_it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Icons",
|
||||
_cf_icons, win);
|
||||
elm_toolbar_item_priority_set(tb_it, 90);
|
||||
|
||||
elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts",
|
||||
_cf_fonts, win);
|
||||
|
||||
|
@ -3965,6 +4128,7 @@ _status_config_full(Evas_Object *win,
|
|||
evas_object_data_set(win, "naviframe", naviframe);
|
||||
|
||||
_status_config_themes(win, naviframe);
|
||||
_status_config_icons(win, naviframe);
|
||||
_status_config_fonts(win, naviframe);
|
||||
_status_config_profiles(win, naviframe);
|
||||
_status_config_rendering(win, naviframe);
|
||||
|
|
|
@ -146,7 +146,7 @@ test_icon_transparent(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
|
|||
|
||||
/* Test: Icon Standard */
|
||||
static void
|
||||
_standard_list_populate(Evas_Object *list, Elm_Icon_Lookup_Order order, int size)
|
||||
_standard_list_populate(Evas_Object *list, int size)
|
||||
{
|
||||
Evas_Object *ic;
|
||||
Eina_List *l;
|
||||
|
@ -168,7 +168,6 @@ _standard_list_populate(Evas_Object *list, Elm_Icon_Lookup_Order order, int size
|
|||
if ((strrchr(name, '-') != NULL) || !strcmp(name, "folder"))
|
||||
{
|
||||
ic = elm_icon_add(list);
|
||||
elm_icon_order_lookup_set(ic, order);
|
||||
elm_icon_standard_set(ic, name);
|
||||
if (size)
|
||||
evas_object_size_hint_min_set(ic, size, size);
|
||||
|
@ -185,14 +184,9 @@ _rdg_changed_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *li = data;
|
||||
Evas_Object *icon = evas_object_data_get(li, "resize_icon");
|
||||
Evas_Object *order_rdg = evas_object_data_get(li, "order_rdg");
|
||||
Evas_Object *size_rdg = evas_object_data_get(li, "size_rdg");
|
||||
|
||||
_standard_list_populate(li, elm_radio_value_get(order_rdg),
|
||||
elm_radio_value_get(size_rdg));
|
||||
|
||||
elm_icon_order_lookup_set(icon, elm_radio_value_get(order_rdg));
|
||||
_standard_list_populate(li, elm_radio_value_get(size_rdg));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -232,7 +226,6 @@ _std_btn_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
icon = elm_icon_add(panes);
|
||||
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_FDO_THEME);
|
||||
elm_icon_standard_set(icon, "folder");
|
||||
elm_object_part_content_set(panes, "left", icon);
|
||||
evas_object_show(icon);
|
||||
|
@ -240,7 +233,6 @@ _std_btn_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
icon = elm_icon_add(panes);
|
||||
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_FDO_THEME);
|
||||
elm_icon_standard_set(icon, "user-home");
|
||||
elm_object_part_content_set(panes, "right", icon);
|
||||
evas_object_show(icon);
|
||||
|
@ -253,7 +245,7 @@ void
|
|||
test_icon_standard(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *win, *li, *box, *hbox, *fr, *rd, *rdg, *icon, *sl, *bt;
|
||||
Evas_Object *win, *li, *box, *hbox, *fr, *rd, *rdg, *label, *icon, *sl, *bt;
|
||||
|
||||
win = elm_win_util_standard_add("icon-test-std", "Icon Standard");
|
||||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
|
@ -267,7 +259,7 @@ test_icon_standard(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_smart_callback_add(li, "selected", _list_selected_cb, NULL);
|
||||
_standard_list_populate(li, ELM_ICON_LOOKUP_FDO_THEME, 0);
|
||||
_standard_list_populate(li, 0);
|
||||
evas_object_show(li);
|
||||
|
||||
// lookup order
|
||||
|
@ -282,37 +274,10 @@ test_icon_standard(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
elm_object_content_set(fr, hbox);
|
||||
evas_object_show(hbox);
|
||||
|
||||
rdg = elm_radio_add(hbox);
|
||||
elm_radio_state_value_set(rdg, ELM_ICON_LOOKUP_FDO_THEME);
|
||||
elm_object_text_set(rdg, "fdo, theme");
|
||||
elm_box_pack_end(hbox, rdg);
|
||||
evas_object_show(rdg);
|
||||
evas_object_smart_callback_add(rdg, "changed", _rdg_changed_cb, li);
|
||||
evas_object_data_set(li, "order_rdg", rdg);
|
||||
|
||||
rd = elm_radio_add(hbox);
|
||||
elm_radio_state_value_set(rd, ELM_ICON_LOOKUP_THEME_FDO);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_object_text_set(rd, "theme, fdo");
|
||||
elm_box_pack_end(hbox, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed", _rdg_changed_cb, li);
|
||||
|
||||
rd = elm_radio_add(hbox);
|
||||
elm_radio_state_value_set(rd, ELM_ICON_LOOKUP_FDO);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_object_text_set(rd, "fdo only");
|
||||
elm_box_pack_end(hbox, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed", _rdg_changed_cb, li);
|
||||
|
||||
rd = elm_radio_add(hbox);
|
||||
elm_radio_state_value_set(rd, ELM_ICON_LOOKUP_THEME);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_object_text_set(rd, "theme only");
|
||||
elm_box_pack_end(hbox, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_smart_callback_add(rd, "changed", _rdg_changed_cb, li);
|
||||
label = elm_label_add(hbox);
|
||||
elm_object_text_set(label, "Lookup order has moved to elementary_config");
|
||||
elm_box_pack_end(hbox, label);
|
||||
evas_object_show(label);
|
||||
|
||||
// size
|
||||
fr = elm_frame_add(box);
|
||||
|
@ -405,7 +370,6 @@ test_icon_standard(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
evas_object_show(hbox);
|
||||
|
||||
icon = elm_icon_add(hbox);
|
||||
elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_FDO_THEME);
|
||||
elm_icon_standard_set(icon, "folder");
|
||||
evas_object_size_hint_min_set(icon, 16, 16);
|
||||
elm_box_pack_end(hbox, icon);
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Definition of special values for user configuration.
|
||||
*/
|
||||
|
||||
#define ELM_CONFIG_ICON_THEME_ELEMENTARY "_Elementary_Icon_Theme"
|
||||
|
||||
|
|
|
@ -500,6 +500,7 @@ _desc_init(void)
|
|||
ELM_CONFIG_VAL(D, T, popup_horizontal_align, T_DOUBLE);
|
||||
ELM_CONFIG_VAL(D, T, popup_vertical_align, T_DOUBLE);
|
||||
ELM_CONFIG_VAL(D, T, spinner_min_max_filter_enable, T_UCHAR);
|
||||
ELM_CONFIG_VAL(D, T, icon_theme, T_STRING);
|
||||
#undef T
|
||||
#undef D
|
||||
#undef T_INT
|
||||
|
@ -1549,6 +1550,7 @@ _config_free(Elm_Config *cfg)
|
|||
eina_stringshare_del(cfg->indicator_service_90);
|
||||
eina_stringshare_del(cfg->indicator_service_180);
|
||||
eina_stringshare_del(cfg->indicator_service_270);
|
||||
eina_stringshare_del(cfg->icon_theme);
|
||||
free(cfg);
|
||||
}
|
||||
|
||||
|
@ -1823,6 +1825,7 @@ _config_load(void)
|
|||
_elm_config->naviframe_prev_btn_auto_pushed = EINA_TRUE;
|
||||
_elm_config->popup_horizontal_align = 0.5;
|
||||
_elm_config->popup_vertical_align = 0.5;
|
||||
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2166,6 +2169,10 @@ _config_update(void)
|
|||
IFCFG(0x0009)
|
||||
_elm_config->scroll_accel_factor = 7.0;
|
||||
IFCFGEND
|
||||
|
||||
IFCFG(0x000a)
|
||||
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
||||
IFCFGEND
|
||||
/**
|
||||
* Fix user config for current ELM_CONFIG_EPOCH here.
|
||||
**/
|
||||
|
@ -2652,6 +2659,26 @@ elm_config_scale_set(double scale)
|
|||
_elm_rescale();
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
elm_config_icon_theme_get(void)
|
||||
{
|
||||
if (!_elm_config->icon_theme)
|
||||
return ELM_CONFIG_ICON_THEME_ELEMENTARY;
|
||||
|
||||
return _elm_config->icon_theme;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_config_icon_theme_set(const char *theme)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->icon_theme);
|
||||
|
||||
if (theme)
|
||||
_elm_config->icon_theme = eina_stringshare_add(theme);
|
||||
else
|
||||
_elm_config->icon_theme = eina_stringshare_add(ELM_CONFIG_ICON_THEME_ELEMENTARY);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_config_password_show_last_get(void)
|
||||
{
|
||||
|
|
|
@ -973,6 +973,29 @@ EAPI double elm_config_scale_get(void);
|
|||
*/
|
||||
EAPI void elm_config_scale_set(double scale);
|
||||
|
||||
/**
|
||||
* Get the icon theme the user has set.
|
||||
*
|
||||
* This gets the global icon theme currently set or the default value
|
||||
* ELM_CONFIG_ICON_THEME_ELEMENTARY.
|
||||
*
|
||||
* @return the icon theme to use
|
||||
* @ingroup Elm_Icon
|
||||
*/
|
||||
EAPI const char *elm_config_icon_theme_get(void);
|
||||
|
||||
/**
|
||||
* Set the icon theme for all elementary apps.
|
||||
*
|
||||
* This method will set the icon theme for all elm_icon_standard_set calls.
|
||||
* Valid parameters are the name of an installed freedesktop.org icon theme
|
||||
* or ELM_CONFIG_ICON_THEME_ELEMENTARY for the built in theme.
|
||||
*
|
||||
* @param the name of a freedesktop.org icon theme or ELM_CONFIG_ICON_THEME_ELEMENTARY
|
||||
* @ingroup Elm_Icon
|
||||
*/
|
||||
EAPI void elm_config_icon_theme_set(const char *theme);
|
||||
|
||||
/**
|
||||
* @defgroup Elm_Password_last_show Password show last
|
||||
* @ingroup Elementary
|
||||
|
|
|
@ -276,7 +276,7 @@ _icon_freedesktop_set(Evas_Object *obj,
|
|||
{
|
||||
Efreet_Icon_Theme *theme;
|
||||
/* TODO: Listen for EFREET_EVENT_ICON_CACHE_UPDATE */
|
||||
theme = efreet_icon_theme_find(getenv("E_ICON_THEME"));
|
||||
theme = efreet_icon_theme_find(elm_config_icon_theme_get());
|
||||
if (!theme)
|
||||
{
|
||||
const char **itr;
|
||||
|
@ -446,35 +446,16 @@ _internal_elm_icon_standard_set(Evas_Object *obj,
|
|||
|
||||
ELM_ICON_DATA_GET(obj, sd);
|
||||
|
||||
/* try locating the icon using the specified lookup order */
|
||||
switch (sd->lookup_order)
|
||||
/* try locating the icon using the specified theme */
|
||||
if (!strcmp(ELM_CONFIG_ICON_THEME_ELEMENTARY, elm_config_icon_theme_get()))
|
||||
{
|
||||
case ELM_ICON_LOOKUP_FDO:
|
||||
ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
break;
|
||||
|
||||
case ELM_ICON_LOOKUP_THEME:
|
||||
ret = _icon_standard_set(obj, name);
|
||||
break;
|
||||
|
||||
case ELM_ICON_LOOKUP_THEME_FDO:
|
||||
ret = _icon_standard_set(obj, name);
|
||||
if (!ret)
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
if (ret && fdo) *fdo = EINA_FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ELM_ICON_LOOKUP_FDO_THEME:
|
||||
default:
|
||||
else
|
||||
{
|
||||
ret = _icon_freedesktop_set(obj, name, _icon_size_min_get(obj));
|
||||
if (!ret)
|
||||
ret = _icon_standard_set(obj, name);
|
||||
else if (fdo)
|
||||
*fdo = EINA_TRUE;
|
||||
break;
|
||||
if (ret && fdo) *fdo = EINA_TRUE;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
|
@ -485,13 +466,17 @@ _internal_elm_icon_standard_set(Evas_Object *obj,
|
|||
}
|
||||
|
||||
if (_path_is_absolute(name))
|
||||
{
|
||||
if (fdo)
|
||||
*fdo = EINA_FALSE;
|
||||
return _icon_file_set(sd, obj, name);
|
||||
}
|
||||
|
||||
/* if that fails, see if icon name is in the format size/name. if so,
|
||||
try locating a fallback without the size specification */
|
||||
if (!(tmp = strchr(name, '/'))) return EINA_FALSE;
|
||||
++tmp;
|
||||
if (*tmp) return elm_icon_standard_set(obj, tmp);
|
||||
if (*tmp) return _internal_elm_icon_standard_set(obj, tmp, fdo);
|
||||
/* give up */
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -530,8 +515,6 @@ _elm_icon_evas_object_smart_add(Eo *obj, Elm_Icon_Data *priv)
|
|||
evas_obj_smart_add(eo_super(obj, MY_CLASS));
|
||||
elm_widget_sub_object_parent_add(obj);
|
||||
|
||||
priv->lookup_order = ELM_ICON_LOOKUP_THEME_FDO;
|
||||
|
||||
priv->thumb.request = NULL;
|
||||
}
|
||||
|
||||
|
@ -774,16 +757,17 @@ _elm_icon_standard_get(Eo *obj EINA_UNUSED, Elm_Icon_Data *sd)
|
|||
return sd->stdicon;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Icon_Data *sd, Elm_Icon_Lookup_Order order)
|
||||
EINA_DEPRECATED EOLIAN static void
|
||||
_elm_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Icon_Data *sd EINA_UNUSED,
|
||||
Elm_Icon_Lookup_Order order EINA_UNUSED)
|
||||
{
|
||||
sd->lookup_order = order;
|
||||
// this method's behaviour has been overridden by elm_config_icon_theme_set
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Icon_Lookup_Order
|
||||
_elm_icon_order_lookup_get(Eo *obj EINA_UNUSED, Elm_Icon_Data *sd)
|
||||
EINA_DEPRECATED EOLIAN static Elm_Icon_Lookup_Order
|
||||
_elm_icon_order_lookup_get(Eo *obj EINA_UNUSED, Elm_Icon_Data *sd EINA_UNUSED)
|
||||
{
|
||||
return sd->lookup_order;
|
||||
return ELM_ICON_LOOKUP_FDO_THEME;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -10,6 +10,8 @@ enum Elm.Icon.Lookup_Order
|
|||
{
|
||||
[[Lookup order used by elm_icon_standard_set(). Should look for icons in
|
||||
the theme, FDO paths, or both?
|
||||
|
||||
Warning: This enum will be removed as the lookup_order is deprecated.
|
||||
]]
|
||||
legacy: elm_icon_lookup;
|
||||
fdo_theme, [[Icon look up order: freedesktop, theme.]]
|
||||
|
@ -24,6 +26,8 @@ class Elm.Icon (Elm.Image)
|
|||
eo_prefix: elm_obj_icon;
|
||||
methods {
|
||||
@property order_lookup {
|
||||
[[Warning: the order_lookup property is deprecated.
|
||||
See elm_config_icon_theme_set instead.]]
|
||||
set {
|
||||
[[Sets the icon lookup order used by elm_icon_standard_set().
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ struct _Elm_Theme
|
|||
* the users config doesn't need to be wiped - simply new values need
|
||||
* to be put in
|
||||
*/
|
||||
#define ELM_CONFIG_FILE_GENERATION 0x0009
|
||||
#define ELM_CONFIG_FILE_GENERATION 0x000a
|
||||
#define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
|
||||
#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
|
||||
ELM_CONFIG_FILE_GENERATION)
|
||||
|
@ -317,6 +317,7 @@ struct _Elm_Config
|
|||
int gl_depth;
|
||||
int gl_stencil;
|
||||
int gl_msaa;
|
||||
const char *icon_theme;
|
||||
|
||||
/* Not part of the EET file */
|
||||
Eina_Bool is_mirrored : 1;
|
||||
|
|
|
@ -311,7 +311,6 @@ _store_item_content_get(void *data, Evas_Object *obj, const char *part)
|
|||
case ELM_STORE_ITEM_MAPPING_ICON:
|
||||
ic = elm_icon_add(obj);
|
||||
s = *(char **)(((unsigned char *)sti->data) + m->offset);
|
||||
elm_icon_order_lookup_set(ic, m->details.icon.lookup_order);
|
||||
evas_object_size_hint_aspect_set(ic,
|
||||
EVAS_ASPECT_CONTROL_VERTICAL,
|
||||
m->details.icon.w,
|
||||
|
|
|
@ -2488,7 +2488,6 @@ _item_new(Evas_Object *obj,
|
|||
elm_interface_atspi_accessible_type_set(VIEW(it), ELM_ATSPI_TYPE_DISABLED);
|
||||
|
||||
icon_obj = elm_icon_add(VIEW(it));
|
||||
elm_icon_order_lookup_set(icon_obj, sd->lookup_order);
|
||||
|
||||
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
|
||||
_access_widget_item_register(it);
|
||||
|
@ -2900,7 +2899,6 @@ _elm_toolbar_evas_object_smart_add(Eo *obj, Elm_Toolbar_Data *priv)
|
|||
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move_cb, obj);
|
||||
evas_object_event_callback_add
|
||||
(priv->bx, EVAS_CALLBACK_RESIZE, _resize_cb, obj);
|
||||
elm_toolbar_icon_order_lookup_set(obj, ELM_ICON_LOOKUP_THEME_FDO);
|
||||
|
||||
_elm_toolbar_highlight_in_theme(obj);
|
||||
_sizing_eval(obj);
|
||||
|
@ -3638,7 +3636,6 @@ _elm_toolbar_item_state_add(Eo *eo_item, Elm_Toolbar_Item_Data *item,
|
|||
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(item, NULL);
|
||||
|
||||
obj = WIDGET(item);
|
||||
ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
|
||||
|
||||
if (!item->states)
|
||||
{
|
||||
|
@ -3650,7 +3647,6 @@ _elm_toolbar_item_state_add(Eo *eo_item, Elm_Toolbar_Item_Data *item,
|
|||
}
|
||||
|
||||
icon_obj = elm_icon_add(obj);
|
||||
elm_icon_order_lookup_set(icon_obj, sd->lookup_order);
|
||||
if (!icon_obj) goto error_state_add;
|
||||
|
||||
if (!_item_icon_set(icon_obj, "toolbar/", icon))
|
||||
|
@ -3814,24 +3810,17 @@ _elm_toolbar_item_state_prev(Eo *eo_item EINA_UNUSED, Elm_Toolbar_Item_Data *ite
|
|||
return eina_list_data_get(prev_state);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_toolbar_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd, Elm_Icon_Lookup_Order order)
|
||||
EINA_DEPRECATED EOLIAN static void
|
||||
_elm_toolbar_icon_order_lookup_set(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd EINA_UNUSED,
|
||||
Elm_Icon_Lookup_Order order EINA_UNUSED)
|
||||
{
|
||||
Elm_Toolbar_Item_Data *it;
|
||||
|
||||
|
||||
if (sd->lookup_order == order) return;
|
||||
sd->lookup_order = order;
|
||||
EINA_INLIST_FOREACH(sd->items, it)
|
||||
elm_icon_order_lookup_set(it->icon, order);
|
||||
if (sd->more_item)
|
||||
elm_icon_order_lookup_set(sd->more_item->icon, order);
|
||||
// this method's behaviour has been overridden by elm_config_icon_theme_set
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Icon_Lookup_Order
|
||||
_elm_toolbar_icon_order_lookup_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
|
||||
EINA_DEPRECATED EOLIAN static Elm_Icon_Lookup_Order
|
||||
_elm_toolbar_icon_order_lookup_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd EINA_UNUSED)
|
||||
{
|
||||
return sd->lookup_order;
|
||||
return ELM_ICON_LOOKUP_FDO_THEME;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
|
@ -106,7 +106,10 @@ class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable,
|
|||
[[Sets icon lookup order, for toolbar items' icons.
|
||||
|
||||
Icons added before calling this function will not be affected.
|
||||
The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.]]
|
||||
The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
|
||||
|
||||
Warning: the icon_order_lookup property is deprecated.
|
||||
See elm_config_icon_theme_set instead.]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
|
|
|
@ -24,7 +24,6 @@ struct _Elm_Icon_Data
|
|||
{
|
||||
Evas_Object *obj; // the object itself
|
||||
const char *stdicon;
|
||||
Elm_Icon_Lookup_Order lookup_order;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@ struct _Elm_Toolbar_Data
|
|||
Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
|
||||
Elm_Toolbar_Item_Data *reorder_empty, *reorder_item;
|
||||
Elm_Toolbar_Shrink_Mode shrink_mode;
|
||||
Elm_Icon_Lookup_Order lookup_order;
|
||||
int theme_icon_size, priv_icon_size,
|
||||
icon_size;
|
||||
int standard_priority;
|
||||
|
|
Loading…
Reference in New Issue