summaryrefslogtreecommitdiff
path: root/src/search_bar.cpp
diff options
context:
space:
mode:
authorJunghyun Kim <jh1114.kim@samsung.com>2012-09-05 07:39:57 (GMT)
committerJunghyun Kim <jh1114.kim@samsung.com>2012-09-05 07:39:57 (GMT)
commit6b4ae042a3dc9026183ab28225f86c2e7fe0824b (patch)
tree97f3f9da48d7560b89ab72261c799ffd6646b24f /src/search_bar.cpp
parent012eaf8203024d43571f27269578cfdf138fdaa0 (diff)
downloadsmartsearch-master.zip
smartsearch-master.tar.gz
smartsearch-master.tar.bz2
Fix layout issue realte to giant font sizeHEADsubmit/master/20120920.1509512.0_alphamaster2.0alpha
Diffstat (limited to 'src/search_bar.cpp')
-rwxr-xr-xsrc/search_bar.cpp139
1 files changed, 79 insertions, 60 deletions
diff --git a/src/search_bar.cpp b/src/search_bar.cpp
index b67c734..3943af4 100755
--- a/src/search_bar.cpp
+++ b/src/search_bar.cpp
@@ -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,