From 0c3a19fefab4c08a2ba3e88c6dc1381b25341afb Mon Sep 17 00:00:00 2001 From: Jagrat Patidar Date: Wed, 28 Oct 2020 15:44:05 +0530 Subject: [PATCH] TIZENIOT-2063 Making clear button to display properly in editfield Change-Id: Ie76b15d6dc1a1150b703c6fe671a24f26a568343 --- edje/images/btn_controller_close.png | Bin 0 -> 352 bytes src/worldclock_add_view.c | 23 ++++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 edje/images/btn_controller_close.png diff --git a/edje/images/btn_controller_close.png b/edje/images/btn_controller_close.png new file mode 100644 index 0000000000000000000000000000000000000000..a1bfa4ec18e4e1856d370814ed0abc4436f84b2c GIT binary patch literal 352 zcmV-m0iXVfP)9kc~L6HRzz-}sZ2O%fk66Cy9Pz4RI=+#*AD)R-BM!_K%qjh8}EZ{al4P4!o z$R2hHzJKoNp1$Ng8e;SwwA&BinjqVObUx1f@<3oJu%3#51;ZD6xNP{RoE=B^y; yf22}DmR%QR_XZO_-;!e=s#p&L&io1K`uP`bjiNU#lBbOT0000searchbar_rect); /* clear button */ - ad->searchbar_button = elm_button_add(ad->searchbar_rect); - elm_object_style_set(ad->searchbar_button, "editfield_clear"); + if (_COMMON) { + ad->searchbar_button = elm_button_add(ad->searchbar_rect); + Evas_Object *img = elm_image_add(ad->searchbar_button); + char buffer[1024] = {0,}; + char *path = app_get_resource_path(); + snprintf(buffer, 1024, "%s%s%s", path, "images/", "btn_controller_close.png"); + elm_image_file_set(img, buffer, NULL); + if (path) { + free(path); + } + evas_object_size_hint_max_set(img, CLEAR_IMAGE_SIZE, CLEAR_IMAGE_SIZE); + elm_object_part_content_set(ad->searchbar_button, "elm.swallow.content", img); + elm_object_style_set(ad->searchbar_button, "focus"); + evas_object_show(ad->searchbar_button); + } else { + ad->searchbar_button = elm_button_add(ad->searchbar_rect); + elm_object_style_set(ad->searchbar_button, "editfield_clear"); + } + evas_object_smart_callback_add(ad->searchbar_button, "clicked", _searchbar_clear_button_clicked_cb, ad->searchbar_entry); elm_object_part_content_set(ad->searchbar_rect, "elm.swallow.button", ad->searchbar_button); - /* current city button */ Evas_Object *location_btn = elm_button_add(searchbar_layout); elm_object_style_set(location_btn, "transparent"); Evas_Object *location_icon = elm_layout_add(location_btn); -- 2.34.1