summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-Taek Hong <sth253.hong@samsung.com>2015-08-07 16:42:29 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-07 16:42:30 +0900
commite43e2cc79505c846e2dfa785c87d3b32c0e5692e (patch)
treee1926b0043bfa201b6ee72ce342cd25ddabcd251
parent46e0686916d89b5af0d0555de907ce745ba68874 (diff)
elm_toolbar: fix icon_size to consider edje base scale
Summary: When icon is set, icon size is calculated without considering edje base scale. This can lead to a miscalculation when base scale is set other than 1.0. @fix Reviewers: seoz, woohyun, cedric, Hermet Reviewed By: Hermet Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2798
-rw-r--r--src/lib/elm_toolbar.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index e04964343..d2797bc88 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -1039,7 +1039,9 @@ _internal_elm_toolbar_icon_size_get(Evas_Object *obj)
1039 const char *icon_size = edje_object_data_get 1039 const char *icon_size = edje_object_data_get
1040 (wd->resize_obj, "icon_size"); 1040 (wd->resize_obj, "icon_size");
1041 1041
1042 if (icon_size) return atoi(icon_size); 1042 if (icon_size)
1043 return (int)(atoi(icon_size) * elm_widget_scale_get(obj) * elm_config_scale_get()
1044 / edje_object_base_scale_get(wd->resize_obj));
1043 1045
1044 return _elm_config->icon_size; 1046 return _elm_config->icon_size;
1045} 1047}
@@ -1239,11 +1241,8 @@ _item_theme_hook(Evas_Object *obj,
1239 } 1241 }
1240 if (it->icon) 1242 if (it->icon)
1241 { 1243 {
1242 int ms = 0; 1244 evas_object_size_hint_min_set(it->icon, icon_size, icon_size);
1243 1245 evas_object_size_hint_max_set(it->icon, icon_size, icon_size);
1244 ms = ((double)icon_size * scale);
1245 evas_object_size_hint_min_set(it->icon, ms, ms);
1246 evas_object_size_hint_max_set(it->icon, ms, ms);
1247 elm_layout_content_set(view, "elm.swallow.icon", it->icon); 1246 elm_layout_content_set(view, "elm.swallow.icon", it->icon);
1248 elm_layout_signal_emit 1247 elm_layout_signal_emit
1249 (view, "elm,state,icon,visible", "elm"); 1248 (view, "elm,state,icon,visible", "elm");
@@ -2396,11 +2395,8 @@ _item_new(Evas_Object *obj,
2396 2395
2397 if (it->icon) 2396 if (it->icon)
2398 { 2397 {
2399 int ms = 0; 2398 evas_object_size_hint_min_set(it->icon, sd->icon_size, sd->icon_size);
2400 2399 evas_object_size_hint_max_set(it->icon, sd->icon_size, sd->icon_size);
2401 ms = ((double)sd->icon_size * elm_config_scale_get());
2402 evas_object_size_hint_min_set(it->icon, ms, ms);
2403 evas_object_size_hint_max_set(it->icon, ms, ms);
2404 elm_layout_content_set(VIEW(it), "elm.swallow.icon", it->icon); 2400 elm_layout_content_set(VIEW(it), "elm.swallow.icon", it->icon);
2405 elm_layout_signal_emit(VIEW(it), "elm,state,icon,visible", "elm"); 2401 elm_layout_signal_emit(VIEW(it), "elm,state,icon,visible", "elm");
2406 evas_object_show(it->icon); 2402 evas_object_show(it->icon);