summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ps_makeupviews.cpp14
-rwxr-xr-xsrc/search_bar.cpp139
2 files changed, 86 insertions, 67 deletions
diff --git a/src/ps_makeupviews.cpp b/src/ps_makeupviews.cpp
index 15d4581..ea9adf7 100755
--- a/src/ps_makeupviews.cpp
+++ b/src/ps_makeupviews.cpp
@@ -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;
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,