summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-16 09:58:02 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-16 10:22:16 +0100
commitd62d380690bce69543e518791025ae79f8f7e65b (patch)
tree2d19bde8a05e156d52f5a67c636bc6a181d9e315 /src/lib/elementary
parent189bb381d62f15601b979df2b47a8aec7c3a409f (diff)
toolbar - dont create icon objects then del if icon is null
if icon is null just never create an icon obj.. but if it's not null it's intended so even if blank, don't delete it - so things line up.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_toolbar.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index d6763cebb6..e3480cd6ad 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -2436,23 +2436,19 @@ _item_new(Evas_Object *obj,
2436 evas_object_data_set(VIEW(it), "item", it); 2436 evas_object_data_set(VIEW(it), "item", it);
2437 efl_access_object_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED); 2437 efl_access_object_access_type_set(VIEW(it), EFL_ACCESS_TYPE_DISABLED);
2438 2438
2439 icon_obj = elm_icon_add(VIEW(it));
2440 efl_parent_set(icon_obj, eo_it);
2441
2442 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 2439 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
2443 _access_widget_item_register(it); 2440 _access_widget_item_register(it);
2444 2441
2445 if (_item_icon_set(icon_obj, "toolbar/", icon)) 2442 if (icon)
2446 { 2443 {
2444 icon_obj = elm_icon_add(VIEW(it));
2445 efl_parent_set(icon_obj, eo_it);
2446 evas_object_size_hint_min_set(icon_obj, sd->icon_size, sd->icon_size);
2447 evas_object_size_hint_max_set(icon_obj, sd->icon_size, sd->icon_size);
2448 _item_icon_set(icon_obj, "toolbar/", icon);
2447 it->icon = icon_obj; 2449 it->icon = icon_obj;
2448 it->icon_str = eina_stringshare_add(icon); 2450 it->icon_str = eina_stringshare_add(icon);
2449 } 2451 }
2450 else
2451 {
2452 it->icon = NULL;
2453 it->icon_str = NULL;
2454 evas_object_del(icon_obj);
2455 }
2456 2452
2457 if (!elm_layout_theme_set 2453 if (!elm_layout_theme_set
2458 (VIEW(it), "toolbar", "item", elm_widget_style_get(obj))) 2454 (VIEW(it), "toolbar", "item", elm_widget_style_get(obj)))
@@ -2473,8 +2469,6 @@ _item_new(Evas_Object *obj,
2473 2469
2474 if (it->icon) 2470 if (it->icon)
2475 { 2471 {
2476 evas_object_size_hint_min_set(it->icon, sd->icon_size, sd->icon_size);
2477 evas_object_size_hint_max_set(it->icon, sd->icon_size, sd->icon_size);
2478 elm_layout_content_set(VIEW(it), "elm.swallow.icon", it->icon); 2472 elm_layout_content_set(VIEW(it), "elm.swallow.icon", it->icon);
2479 elm_layout_signal_emit(VIEW(it), "elm,state,icon,visible", "elm"); 2473 elm_layout_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
2480 elm_layout_signal_emit(VIEW(it), "elm,icon,visible", "elm"); 2474 elm_layout_signal_emit(VIEW(it), "elm,icon,visible", "elm");