From b4ed410b9133c692fc20171ef3061f8b0b912d95 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 21 Jan 2016 12:28:42 +1000 Subject: Evil hack around ELM's problem with lack of toolbar item icons. --- media/spacer.png | Bin 0 -> 83 bytes src/extantz/extantz.c | 10 +++++----- src/extantz/woMan.c | 6 +++--- src/libraries/winFang.c | 11 ++++++++++- src/libraries/winFang.h | 2 ++ 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 media/spacer.png diff --git a/media/spacer.png b/media/spacer.png new file mode 100644 index 0000000..bf91fa5 Binary files /dev/null and b/media/spacer.png differ diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 1091c87..07e6502 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -461,11 +461,11 @@ static winFang *_makeMainMenu(globals *ourGlobals) makeMainMenuFinish(me, tb); // Other stuff in the toolbar. - it = elm_toolbar_item_append(tb, NULL, "restriction icons", NULL, NULL); - it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); - it = elm_toolbar_item_append(tb, NULL, "hop://localhost/Anarchadia 152, 155, 51 - Lost plot (Adult)", NULL, NULL); - it = elm_toolbar_item_append(tb, NULL, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); - it = elm_toolbar_item_append(tb, NULL, "date time:o'clock", NULL, NULL); + it = elm_toolbar_item_append(tb, NoIcon, "restriction icons", NULL, NULL); + it = elm_toolbar_item_append(tb, NoIcon, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); + it = elm_toolbar_item_append(tb, NoIcon, "hop://localhost/Anarchadia 152, 155, 51 - Lost plot (Adult)", NULL, NULL); + it = elm_toolbar_item_append(tb, NoIcon, NULL, NULL, NULL); elm_toolbar_item_separator_set(it, EINA_TRUE); + it = elm_toolbar_item_append(tb, NoIcon, "date time:o'clock", NULL, NULL); elm_layout_box_prepend(me->layout, WF_BOX, tb); diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index 42390cc..c867241 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c @@ -250,10 +250,10 @@ winFang *woMan_add(globals *ourGlobals) evas_object_show(nf); sprintf(buf, "%s/%s", prefix_data_get(), img3); - tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it); + tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NoIcon, "Viewers", _promote, tab_it); // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away. - tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it); - tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Grids", _promote, tab_it); + tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NoIcon, "Landmarks", _promote, tab_it); + tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NoIcon, "Grids", _promote, tab_it); elm_layout_box_append(me->win, WF_BOX, nf); bt = eo_add(ELM_BUTTON_CLASS, me->win, diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index 0f2c5a5..df9f5fa 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c @@ -225,6 +225,15 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch // result->bg = edje_object_part_object_get(elm_layout_edje_get(result->layout), WF_BACKGROUND); + if (0 == NoIcon[0]) + snprintf(NoIcon, sizeof(NoIcon), "%s/spacer.png", prefix_data_get()); +/* This aint doing shit. B-( + obj = elm_icon_add(obj); + elm_icon_order_lookup_set(obj, ELM_ICON_LOOKUP_THEME_FDO); + elm_icon_standard_set(obj, NoIcon); + elm_image_file_set(obj, NoIcon, NULL); +*/ + if (result->parent) { result->win = result->layout; @@ -545,7 +554,7 @@ Evas_Object *menuAdd(winFang *win, Evas_Object *tb, char *label) // Evas_Object * obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data // The function is called when the item is clicked. - tb_it = elm_toolbar_item_append(tb, NULL, label, NULL, NULL); + tb_it = elm_toolbar_item_append(tb, NoIcon, label, NULL, NULL); // Mark it as a menu. elm_toolbar_item_menu_set(tb_it, EINA_TRUE); // This alledgedly marks it as a menu (not true), and gets an Evas_Object for us to play with. diff --git a/src/libraries/winFang.h b/src/libraries/winFang.h index 91ceb0c..1885ca1 100644 --- a/src/libraries/winFang.h +++ b/src/libraries/winFang.h @@ -13,6 +13,8 @@ #define WF_BOX "winFang/box" #define WF_SWALLOW "winFang/content" +// Evil hack around ELM's problem with lack of toolbar item icons. +char NoIcon[PATH_MAX]; typedef struct _widgetSpec { -- cgit v1.1