TIZENIOT-2063 Making clear button to display properly in editfield 40/252140/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/hotfix/20210127.093430 submit/tizen_6.0_hotfix/20210123.062921
authorJagrat Patidar <j1.patidar@samsung.com>
Wed, 28 Oct 2020 10:14:05 +0000 (15:44 +0530)
committerMohit Kumar <mohit.kr1@samsung.com>
Sat, 23 Jan 2021 06:19:24 +0000 (06:19 +0000)
Change-Id: Ie76b15d6dc1a1150b703c6fe671a24f26a568343
(cherry picked from commit 0c3a19fefab4c08a2ba3e88c6dc1381b25341afb)
(cherry picked from commit 9a79d3f13ac6c176b3b70435ac77d7e7274f5f4d)

edje/images/btn_controller_close.png [new file with mode: 0644]
src/worldclock_add_view.c

diff --git a/edje/images/btn_controller_close.png b/edje/images/btn_controller_close.png
new file mode 100644 (file)
index 0000000..a1bfa4e
Binary files /dev/null and b/edje/images/btn_controller_close.png differ
index 30668e6..495228b 100755 (executable)
@@ -44,6 +44,7 @@
 #define MAX_TITLE_NAME                 128
 #define NORMAL_TIMEOUT_VALUE   0.01
 #define EXTENDED_TIMEOUT_VALUE 0.2
+#define CLEAR_IMAGE_SIZE 15
 
 #define sncat(to, size, from) \
                ({strncat((to), (from), ((size) - strlen(to) - 1)); })
@@ -1218,12 +1219,28 @@ static Evas_Object *__ugview_searchbar_add(Evas_Object *parent, void *data)
        elm_object_part_content_set(searchbar_layout, "entry_part", ad->searchbar_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);