#define SEARCH_TITLE_COLOR_GUIDE_TEXT_FOCUSED "<font_size=40><color=#EAEAEA91>"
#define SEARCH_TITLE_COLOR_GUIDE_TEXT_UNFOCUSED "<font_size=40><color=#EAEAEA6D>"
#define SEARCH_TITLE_COLOR_GUIDE_TEXT_END_TEXT_TAG "</color></font_size>"
+#define SEARCH_ENTRY_GUIDE_SYMBOL_MAGNIFIER "\uf897"
#define SEARCH_ENTRY_GUIDE_TEXT_SIZE 512
static void _editfield_focused_cb(void *data, Evas_Object *obj, void *event_info);
static void _editfield_with_clear_btn_changed_cb(void *data, Evas_Object *obj, void *event_info);
static void _clear_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void _editfield_search_title_entry_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _editfield_search_title_guide_text_update(Evas_Object *entry, Eina_Bool is_entry_focused);
static void _on_system_settings_change_cb(system_settings_key_e key, void *user_data);
void email_common_util_editfield_create(Evas_Object *parent, int flags, email_editfield_t *editfield)
/* additional callback for changing guide text color on unfocus event */
evas_object_smart_callback_add(entry, "unfocused", _editfield_search_title_unfocused_cb, editfield);
+
+ /*set guide text "Search"*/
+ _editfield_search_title_guide_text_update(entry, EINA_FALSE);
}
if (flags & EF_PASSWORD) {
{
debug_enter();
retm_if(!data, "Invalid parameter: data is NULL!");
-
email_editfield_t *editfield = (email_editfield_t *)data;
- char temp[SEARCH_ENTRY_GUIDE_TEXT_SIZE] = { 0 };
- snprintf(temp, sizeof(temp), "%s%s%s", SEARCH_TITLE_COLOR_GUIDE_TEXT_FOCUSED, _("IDS_EMAIL_OPT_SEARCH"), SEARCH_TITLE_COLOR_GUIDE_TEXT_END_TEXT_TAG);
- elm_object_part_text_set(editfield->entry, "elm.guide", temp);
+ _editfield_search_title_guide_text_update(editfield->entry, EINA_TRUE);
debug_leave();
}
{
debug_enter();
retm_if(!data, "Invalid parameter: data is NULL!");
-
email_editfield_t *editfield = (email_editfield_t *)data;
+ _editfield_search_title_guide_text_update(editfield->entry, EINA_FALSE);
+
+ debug_leave();
+}
+
+static void _editfield_search_title_guide_text_update(Evas_Object *entry, Eina_Bool is_entry_focused)
+{
+ debug_enter();
+ retm_if(!entry, "Invalid parameter: data is NULL!");
+
char temp[SEARCH_ENTRY_GUIDE_TEXT_SIZE] = { 0 };
- snprintf(temp, sizeof(temp), "%s%s%s", SEARCH_TITLE_COLOR_GUIDE_TEXT_UNFOCUSED, _("IDS_EMAIL_OPT_SEARCH"), SEARCH_TITLE_COLOR_GUIDE_TEXT_END_TEXT_TAG);
- elm_object_part_text_set(editfield->entry, "elm.guide", temp);
+ const char *start_tag_string = NULL;
+
+ if (is_entry_focused) {
+ start_tag_string = SEARCH_TITLE_COLOR_GUIDE_TEXT_FOCUSED;
+ } else {
+ start_tag_string = SEARCH_TITLE_COLOR_GUIDE_TEXT_UNFOCUSED;
+ }
+ snprintf(temp, sizeof(temp), "%s%s %s%s", start_tag_string, SEARCH_ENTRY_GUIDE_SYMBOL_MAGNIFIER, _("IDS_EMAIL_OPT_SEARCH"), SEARCH_TITLE_COLOR_GUIDE_TEXT_END_TEXT_TAG);
+ elm_object_part_text_set(entry, "elm.guide", temp);
debug_leave();
}
static void _editfield_search_title_entry_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
+ debug_enter();
+ retm_if(!data, "Invalid parameter: data is NULL!");
email_editfield_t *editfield = (email_editfield_t *)data;
editfield->entry = NULL;
email_unregister_accessibility_font_size_changed_callback(_on_system_settings_change_cb);
email_unregister_language_changed_callback(_on_system_settings_change_cb);
+ debug_leave();
}
static void _on_system_settings_change_cb(system_settings_key_e key, void *data)
{
- email_editfield_t *editfield = (email_editfield_t *)data;
-
- if (!editfield->entry) {
- return;
- }
+ debug_enter();
+ retm_if(!data, "Invalid parameter: data is NULL!");
- char temp[SEARCH_ENTRY_GUIDE_TEXT_SIZE] = { 0 };
- const char *start_tag_string = NULL;
+ email_editfield_t *editfield = (email_editfield_t *)data;
+ _editfield_search_title_guide_text_update(editfield->entry, elm_object_focus_get(editfield->entry));
- if (elm_object_focus_get(editfield->entry)) {
- start_tag_string = SEARCH_TITLE_COLOR_GUIDE_TEXT_FOCUSED;
- } else {
- start_tag_string = SEARCH_TITLE_COLOR_GUIDE_TEXT_UNFOCUSED;
- }
- snprintf(temp, sizeof(temp), "%s%s%s", start_tag_string, _("IDS_EMAIL_OPT_SEARCH"), SEARCH_TITLE_COLOR_GUIDE_TEXT_END_TEXT_TAG);
- elm_object_part_text_set(editfield->entry, "elm.guide", temp);
+ debug_leave();
}