Fix layout issue realte to giant font size 2.0alpha master 2.0_alpha submit/master/20120920.150951
authorJunghyun Kim <jh1114.kim@samsung.com>
Wed, 5 Sep 2012 07:39:57 +0000 (16:39 +0900)
committerJunghyun Kim <jh1114.kim@samsung.com>
Wed, 5 Sep 2012 07:39:57 +0000 (16:39 +0900)
data/groups/search_result.edc
data/smartsearch.edc
include/smartsearch.h
src/ps_makeupviews.cpp
src/search_bar.cpp

index e3a17f7..abd5853 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 group {
        name: "smartsearch/search_result";
        parts {
-               part { 
+               part {
                        name: "bg";
                        mouse_events: 0;
                        type: RECT;
                        scale: 1;
-                       description { 
+                       description {
                        state: "default" 0.0;
                        visible: 1;
                        rel1 { relative: 0.0 0.0;}
                        rel2 { relative: 1.0 1.0;}
-                       color: 0 0 0 0;
+                       color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
                        }
                }
                part {
+            name: "searchbar_pad_top";
+            type: RECT;
+            mouse_events: 0;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 0 16;
+                fixed: 0 1;
+                align: 0.0 0.0;
+                rel1 { relative: 0.0 0.0; to: "bg";}
+                rel2 { relative: 1.0 0.0; to: "bg";}
+                color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+            }
+        }
+
+        part {
+            name: "searchbar_area_category_pad_left";
+            type: RECT;
+            mouse_events: 0;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 16 0;
+                fixed: 0 1;
+                align: 0.0 0.0;
+                rel1 { relative: 0.0 1.0;
+                        to_x: "searchbar_pad_top";
+                               to_y: "searchbar_pad_top";}
+                rel2 { relative: 0.0 1.0;
+                               to_x: "searchbar_pad_top";
+                               to_y: "searchbar_pad_top";}
+                color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+            }
+        }
+
+        part {
+            name: "searchbar_category_area";
+            type: RECT;
+            mouse_events: 0;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 80 0;
+                fixed: 0 1;
+                align: 0.0 0.0;
+                rel1 { relative: 1.0 1.0;
+                               to_x: "searchbar_area_category_pad_left";
+                               to_y: "searchbar_pad_top";}
+                rel2 { relative: 1.0 1.0;
+                               to_x: "searchbar_area_category_pad_left";
+                               to_y: "searchbar_pad_top";}
+                color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+            }
+        }
+
+        part {
+                       name: "searchbar_area_entry";
+                       type: SWALLOW;
+                       mouse_events: 1;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 0 72;
+                               fixed: 0 1;
+                               align: 0.0 0.0;
+                               rel1 { relative: 1.0 1.0;
+                               to_x: "searchbar_category_area";
+                               to_y: "searchbar_pad_top";}
+                               rel2 { relative: 1.0 1.0;
+                               to_x: "searchbar_pad_top";
+                               to_y: "searchbar_pad_top";}
+                       }
+               }
+
+        part {
+            name: "searchbar_pad_bottom";
+            type: RECT;
+            mouse_events: 0;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 0 16;
+                fixed: 0 1;
+                align: 0.0 0.0;
+                rel1 { relative: 0.0 1.0;
+                               to_x: "searchbar_pad_top";
+                               to_y: "searchbar_area_entry";}
+                rel2 { relative: 0.0 1.0;
+                               to_x: "searchbar_area_entry";
+                               to_y: "searchbar_area_entry";}
+                color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+                       }
+               }
+
+        part {
+            name: "searchbar_area_category_bg";
+            type: RECT;
+            mouse_events: 1;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 0 0;
+                fixed: 0 1;
+                align: 0.0 0.5;
+                rel1 { relative: 0.0 0.0;
+                               to_x: "searchbar_area_category_pad_left";
+                               to_y: "searchbar_area_entry";}
+                rel2 { relative: 0.0 1.0;
+                               to_x: "searchbar_area_entry";
+                               to_y: "searchbar_area_entry";}
+                color: SEARCHBAR_BACKGROUND_COLOR_DEFAULT;
+            }
+        }
+
+        part {
+            name: "searchbar_area_category";
+            type: SWALLOW;
+            mouse_events: 1;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 80 74;
+                //max: 0 106;
+                fixed: 0 1;
+                align: 0.0 0.5;
+                rel1 { relative: 0.0 0.5;
+                               to_x: "searchbar_category_area";
+                               to_y: "searchbar_area_entry";}
+                rel2 { relative: 1.0 0.5;
+                               to_x: "searchbar_category_area";
+                               to_y: "searchbar_area_entry";}
+            }
+        }
+
+        part {
+            name: "result_bg";
+            type: RECT;
+            mouse_events: 1;
+            scale: 1;
+            description {
+                state: "default" 0.0;
+                visible: 1;
+                min: 0 0;
+                fixed: 0 1;
+                rel1 { relative: 0.0 1.0;
+                               to_x: "searchbar_pad_bottom";
+                               to_y: "searchbar_pad_bottom";}
+                rel2 { relative: 1.0 1.0;
+                               to_x: "bg";
+                               to_y: "bg";}
+                color: 255 255 255 255;
+            }
+        }
+
+               part {
                        name: "list";
                        type: SWALLOW;
                        mouse_events: 1;
@@ -42,7 +203,7 @@ group {
                                state: "default" 0.0;
                                //min: 720 1024;
                                align: 0.0 0.0;
-                               rel1 { relative: 0.0 0.0; to: "bg"; }
+                               rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
                                rel2 { relative: 1.0 1.0; to: "bg"; }
                        }
                }
@@ -55,7 +216,7 @@ group {
                                state: "default" 0.0;
                                //min: 720 1024;
                                align: 0.0 0.0;
-                               rel1 { relative: 0.0 0.0; to: "bg"; }
+                               rel1 { relative: 0.0 1.0; to: "searchbar_pad_bottom"; }
                                rel2 { relative: 1.0 1.0; to: "bg"; }
                        }
                }
index 643fabd..0061e2c 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,6 +20,5 @@
 collections {
 #include "smartsearch-color.edc"
 #include "groups/search_result.edc"
-#include "groups/search_bar.edc"
 #include "groups/ug_effect.edc"
 }
index 4277e34..5c80cbf 100755 (executable)
@@ -122,9 +122,6 @@ struct appdata {
        Evas_Object *search_gl;
        Evas_Object *noresult_view;
        Evas_Object *sb_layout;
-       Evas_Object *search_layout;
-       Evas_Object *result_layout;
-
        Evas_Object *back_btn;
 
        Evas_Object *ctxpopup;
index 15d4581..ea9adf7 100755 (executable)
@@ -1039,12 +1039,12 @@ void search_layout_set_search_list(void* data)
 
        struct appdata *ad = (struct appdata *)data;
 
-       if (elm_object_part_content_get(ad->result_layout,"list_noresult")) {
-               elm_object_part_content_unset(ad->result_layout,"list_noresult");
+       if (elm_object_part_content_get(ad->sb_layout,"list_noresult")) {
+               elm_object_part_content_unset(ad->sb_layout,"list_noresult");
                evas_object_hide(ad->noresult_view);
 
                if (ad->search_gl) {
-                       elm_object_part_content_set(ad->result_layout, "list", ad->search_gl);
+               elm_object_part_content_set(ad->sb_layout, "list", ad->search_gl);
                evas_object_show(ad->search_gl);
        }
        }
@@ -1062,13 +1062,13 @@ void search_layout_set_search_no_result(void* data)
 
        struct appdata *ad = (struct appdata *)data;
 
-       if (elm_object_part_content_get(ad->result_layout, "list")) {
-               elm_object_part_content_unset(ad->result_layout, "list");
+       if (elm_object_part_content_get(ad->sb_layout,"list")) {
+               elm_object_part_content_unset(ad->sb_layout, "list");
 
                if (ad->search_gl)
                evas_object_hide(ad->search_gl);
 
-               elm_object_part_content_set(ad->result_layout,"list_noresult", ad->noresult_view);
+               elm_object_part_content_set(ad->sb_layout,"list_noresult", ad->noresult_view);
                evas_object_show(ad->noresult_view);
        }
 
@@ -1084,7 +1084,7 @@ int search_layout_get_content_list_set_status(void* data)
        struct appdata *ad = (struct appdata *)data;
        int ret;
 
-       if (elm_object_part_content_get(ad->result_layout, "list")) {
+       if (elm_object_part_content_get(ad->sb_layout,"list")) {
                ret = SEARCH_RET_SUCCESS;
        } else {
                ret = SEARCH_RET_FAIL;
index b67c734..3943af4 100755 (executable)
@@ -214,24 +214,24 @@ __search_searchbar_state_event_cb(void *data, Ecore_IMF_Context *imf_context, in
        SEARCH_FUNC_END;
 }
 
-static Evas_Object* __search_searchbar_create(void *data)
+static void __search_searchbar_create(void *data)
 {
        SEARCH_FUNC_START;
 
        struct appdata *ad = (struct appdata *)data;
-       int category = 0;
-       Evas_Object *search_layout = NULL;
-       Evas_Object *cate_btn;
-       Evas_Object *cate_icon;
-       char *imgpath = NULL;
-
        if (!ad)
-               return NULL;
+               return;
 
        if (ad->search_bar) {
-               elm_object_signal_callback_del(ad->search_bar, "elm,bg,clicked", "elm",
+               elm_object_signal_callback_del(
+                                                               ad->search_bar,
+                                                               "elm,bg,clicked",
+                                                               "elm",
                                                                __search_searchbar_bg_clicked_cb);
-               elm_object_signal_callback_del(ad->search_bar, "elm,eraser,clicked", "elm",
+               elm_object_signal_callback_del(
+                                                               ad->search_bar,
+                                                               "elm,eraser,clicked",
+                                                               "elm",
                                                                __search_searchbar_eraser_clicked_cb);
 
                evas_object_del(ad->search_bar);
@@ -239,13 +239,21 @@ static Evas_Object* __search_searchbar_create(void *data)
        }
 
        if (ad->search_entry) {
-               evas_object_smart_callback_del(ad->search_entry, "changed",
+               evas_object_smart_callback_del(
+                                                               ad->search_entry,
+                                                               "changed",
                                                                __search_searchbar_entry_changed_cb);
-               evas_object_smart_callback_del(ad->search_entry, "preedit,changed",
+               evas_object_smart_callback_del(
+                                                               ad->search_entry,
+                                                               "preedit,changed",
                                                                __search_searchbar_entry_changed_cb);
-               evas_object_smart_callback_del(ad->search_entry, "focused",
+               evas_object_smart_callback_del(
+                                                               ad->search_entry,
+                                                               "focused",
                                                                __search_searchbar_entry_focused_cb);
-               evas_object_smart_callback_del(ad->search_entry, "unfocused",
+               evas_object_smart_callback_del(
+                                                               ad->search_entry,
+                                                               "unfocused",
                                                                __search_searchbar_entry_unfocused_cb);
 
                evas_object_del(ad->search_entry);
@@ -253,31 +261,15 @@ static Evas_Object* __search_searchbar_create(void *data)
        }
 
        if (ad->search_cancel_btn) {
-               evas_object_smart_callback_del(ad->search_cancel_btn, "clicked",
+               evas_object_smart_callback_del(
+                                                               ad->search_cancel_btn,
+                                                               "clicked",
                                               __search_searchbar_cancel_clicked_cb);
                evas_object_del(ad->search_cancel_btn);
                ad->search_cancel_btn = NULL;
        }
 
-       search_layout = elm_layout_add(ad->sb_layout);
-       elm_layout_file_set(search_layout,
-                                               SEARCH_EDJ,
-                                               "smartsearch/search_bar");
-
-       imgpath = ad->category_info[ad->search_category].btn_icon_path;
-       cate_icon = search_searchbar_category_icon_add(imgpath, search_layout);
-       cate_btn = elm_button_add(search_layout);
-
-       elm_object_style_set(cate_btn, "icon");
-       elm_object_content_set(ad->cate_btn, cate_icon);
-
-       evas_object_show(cate_btn);
-       ad->cate_btn = cate_btn;
-
-       elm_object_part_content_set(search_layout, "searchbar_area_category", cate_btn);
-
-       /* Make Search entry with cancel button */
-       ad->search_bar = elm_layout_add(search_layout);
+       ad->search_bar = elm_layout_add(ad->navi_bar);
        elm_layout_theme_set(ad->search_bar , "layout", "searchbar", "cancel_button");
 
        ad->search_cancel_btn = elm_button_add(ad->search_bar);
@@ -292,8 +284,8 @@ static Evas_Object* __search_searchbar_create(void *data)
        elm_object_part_text_set(ad->search_bar, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
        elm_entry_cnp_mode_set(ad->search_entry, ELM_CNP_MODE_PLAINTEXT);
 
-       evas_object_size_hint_weight_set(ad->search_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(ad->search_bar, EVAS_HINT_EXPAND, 0);
+       evas_object_size_hint_align_set(ad->search_bar, EVAS_HINT_FILL, 0.0);
 
        elm_entry_input_panel_layout_set(ad->search_entry, ELM_INPUT_PANEL_LAYOUT_NORMAL);
        Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(ad->search_entry);
@@ -302,43 +294,57 @@ static Evas_Object* __search_searchbar_create(void *data)
                                                         __search_searchbar_state_event_cb,
                                                         data);
 
-       elm_object_part_content_set(search_layout, "searchbar_area_entry", ad->search_bar);
-
        /* Set Searchbar Callback */
-       elm_object_signal_callback_add(ad->search_bar, "elm,bg,clicked", "elm",
+       elm_object_signal_callback_add(
+                                                               ad->search_bar,
+                                                               "elm,bg,clicked",
+                                                               "elm",
                                                                __search_searchbar_bg_clicked_cb,
                                                                ad);
-       elm_object_signal_callback_add(ad->search_bar, "elm,eraser,clicked", "elm",
+       elm_object_signal_callback_add(
+                                                               ad->search_bar,
+                                                               "elm,eraser,clicked",
+                                                               "elm",
                                                                __search_searchbar_eraser_clicked_cb,
                                                                ad);
 
        /* Set Search-Entry Callback */
-       evas_object_smart_callback_add(ad->search_entry, "changed",
+       evas_object_smart_callback_add(
+                                                               ad->search_entry,
+                                                               "changed",
                                                                __search_searchbar_entry_changed_cb,
                                                                ad);
-       evas_object_smart_callback_add(ad->search_entry, "preedit,changed",
+       evas_object_smart_callback_add(
+                                                               ad->search_entry,
+                                                               "preedit,changed",
                                                                __search_searchbar_entry_changed_cb,
                                                                ad);
 
-       evas_object_smart_callback_add(ad->search_entry, "focused",
+       evas_object_smart_callback_add(
+                                                               ad->search_entry,
+                                                               "focused",
                                                                __search_searchbar_entry_focused_cb,
                                                                ad);
-       evas_object_smart_callback_add(ad->search_entry, "unfocused",
+       evas_object_smart_callback_add(
+                                                               ad->search_entry,
+                                                               "unfocused",
                                                                __search_searchbar_entry_unfocused_cb,
                                                                ad);
-       evas_object_event_callback_add(ad->search_entry, EVAS_CALLBACK_KEY_DOWN,
+       evas_object_event_callback_add(
+                                                               ad->search_entry,
+                                                               EVAS_CALLBACK_KEY_DOWN,
                                                                __search_searchbar_key_down_cb,
                                                        ad);
 
        /* Set Searchbar Cancel Button Callback */
-       evas_object_smart_callback_add(ad->search_cancel_btn, "clicked",
+       evas_object_smart_callback_add(
+                                                               ad->search_cancel_btn,
+                                                               "clicked",
                                                                __search_searchbar_cancel_clicked_cb,
                                                                ad);
 
        evas_object_show(ad->search_bar);
 
-       return search_layout;
-
        SEARCH_FUNC_END;
 }
 
@@ -390,30 +396,43 @@ void search_searchbar_cb(void *data, Evas_Object * obj, void *event_info)
 
        struct appdata *ad = (struct appdata *)data;
 
-       /* create layout */
+       Evas_Object *cate_btn;
+       Evas_Object *cate_icon;
+       int category = 0;
+       char *imgpath = NULL;
 
+       /* create layout */
        ad->sb_layout = elm_layout_add(ad->navi_bar);
-       elm_layout_theme_set(ad->sb_layout, "layout", "application", "searchbar_base");
-       elm_object_signal_emit(ad->sb_layout, "elm,state,show,searchbar", "elm");
+       elm_layout_file_set(ad->sb_layout,
+                                               SEARCH_EDJ,
+                                               "smartsearch/search_result");
+
+               category = SEARCH_CATE_PHONE;
+
+       imgpath = ad->category_info[ad->search_category].btn_icon_path;
+       cate_icon = search_searchbar_category_icon_add(imgpath, ad->sb_layout);
+       cate_btn = elm_button_add(ad->sb_layout);
+       elm_object_content_set(ad->cate_btn, cate_icon);
+
+       evas_object_show(cate_btn);
+       ad->cate_btn = cate_btn;
+
+       elm_object_part_content_set(ad->sb_layout, "searchbar_area_category", cate_btn);
 
        /* set search bar area */
-       ad->search_layout = __search_searchbar_create(ad);
-       elm_object_part_content_set(ad->sb_layout, "searchbar", ad->search_layout);
 
-       /* set search result area */
-       ad->result_layout = elm_layout_add(ad->sb_layout);
-       elm_layout_file_set(ad->result_layout,
-                                               SEARCH_EDJ,
-                                               "smartsearch/search_result");
+       __search_searchbar_create(ad);
+
+       elm_object_part_content_set(ad->sb_layout, "searchbar_area_entry", ad->search_bar);
 
        /* set search result area */
+
        ad->noresult_view = __search_init_noresult_view(ad);
 
-       elm_object_part_content_set(ad->result_layout,
+       elm_object_part_content_set(ad->sb_layout,
                                                "list_noresult",
                                                ad->noresult_view);
 
-       elm_object_part_content_set(ad->sb_layout, "elm.swallow.content", ad->result_layout);
        evas_object_size_hint_weight_set(
                                                        ad->sb_layout,
                                                        EVAS_HINT_EXPAND,