[Elm_Entry] Show magnifier when selection handlers are pressed or moved.

Show magnifier when selection handlers are pressed or moved.
This patch is depended on D171 patch.

Conflicts:

	ChangeLog
	NEWS
This commit is contained in:
Thiep Ha 2013-06-22 12:36:27 +09:00 committed by Carsten Haitzler (Rasterman)
parent ca66c7cc6c
commit d062cc2004
3 changed files with 62 additions and 1 deletions

View File

@ -1399,6 +1399,7 @@
* Add magnifier to entry.
<<<<<<< HEAD
2013-06-10 ChunEon Park (Hermet)
* Remove the keyboard area in the conformant if the keyboard state is off.
@ -1441,4 +1442,4 @@
2013-06-22 Thiep Ha
* Move cursor when mouse moves with longpress.
* Show magnifier when selection handlers are pressed or moved.

View File

@ -115,6 +115,7 @@ Improvements:
* Don't try to pop the naviframe item multiple times.
* Support language change for widget items (Ctxpopup, Hoversel, Naviframe, Diskselector, List, Menu, Segment_Control, Toolbar, Popup, MultibuttonEntry)
* Move cursor when mouse moves with longpress.
* Show magnifier when selection handlers are pressed or moved.
Fixes:
* Now elm_datetime_field_limit_set() can set year limits wihtout problems.

View File

@ -1464,6 +1464,56 @@ _long_press_cb(void *data)
return ECORE_CALLBACK_CANCEL;
}
static void
_entry_handler_move_start_cb(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
ELM_ENTRY_DATA_GET(data, sd);
Evas_Coord x, y, cx, cy, ch;
evas_object_geometry_get(sd->entry_edje, &x, &y, NULL, NULL);
edje_object_part_text_cursor_geometry_get(sd->entry_edje,
"elm.text",
&cx, &cy, NULL, &ch);
if (_elm_config->magnifier_enable)
{
_magnifier_create(data);
_magnifier_show(data);
_magnifier_move(data, x + cx, y + cy + ch/2);
}
}
static void
_entry_handler_move_end_cb(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
if (_elm_config->magnifier_enable)
_magnifier_hide(data);
if (!_elm_config->desktop_entry)
_menu_call(data);
}
static void
_entry_handler_moving_cb(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
ELM_ENTRY_DATA_GET(data, sd);
Evas_Coord x, y, cx, cy, ch;
evas_object_geometry_get(sd->entry_edje, &x, &y, NULL, NULL);
edje_object_part_text_cursor_geometry_get(sd->entry_edje,
"elm.text",
&cx, &cy, NULL, &ch);
if (_elm_config->magnifier_enable)
_magnifier_move(data, x + cx, y + cy + ch/2);
}
static void
_key_down_cb(void *data,
Evas *evas __UNUSED__,
@ -3030,6 +3080,15 @@ _elm_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
edje_object_signal_callback_add
(priv->entry_edje, "entry,redo,request", "elm.text",
_entry_redo_request_signal_cb, obj);
edje_object_signal_callback_add
(priv->entry_edje, "handler,move,start", "elm.text",
_entry_handler_move_start_cb, obj);
edje_object_signal_callback_add
(priv->entry_edje, "handler,move,end", "elm.text",
_entry_handler_move_end_cb, obj);
edje_object_signal_callback_add
(priv->entry_edje, "handler,moving", "elm.text",
_entry_handler_moving_cb, obj);
elm_layout_text_set(obj, "elm.text", "");