From: Jihoon Kim <imfine98@gmail.com>

Subject: [E-devel] [PATCH] bug fix in : "cursor, changed" signal is
not emitted when the content of entry is removed

I found the bug that "cursor,changed" signal is not emitted when the content
of entry is removed.

Let's assume the cursor position is equal to 10.
In this situation, elm_entry_entry_set(en, "") is called.
The content of entry is removed and the cursor position is equal to 0, but
"cursor,changed" signal is not emitted.

This patch is for solving this problem.

In addition, it lets the input method module know the cursor position using
ecore_imf_context_cursor_position_set API
in case that _edje_entry_set_cursor_{start, end} is called.

(Raster: actually it should always emit changed. not check pos at all.
technically pos could be the same BUT cursor moved on screen due to a
reformat). :)



SVN revision: 58886
This commit is contained in:
Jihoon Kim 2011-04-25 05:36:58 +00:00 committed by Carsten Haitzler
parent 15d22f9c47
commit ac33622354
1 changed files with 13 additions and 0 deletions

View File

@ -2036,12 +2036,14 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
{
Entry *en = rp->entry_data;
if (!en) return;
// set text as markup
_sel_clear(en->cursor, rp->object, en);
evas_object_textblock_text_markup_set(rp->object, text);
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_set_cursor_start(rp);
}
@ -2079,6 +2081,11 @@ _edje_entry_set_cursor_start(Edje_Real_Part *rp)
Entry *en = rp->entry_data;
if (!en) return;
_curs_start(en->cursor, rp->object, en);
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
ecore_imf_context_cursor_position_set(en->imf_context, 0);
#endif
}
void
@ -2087,6 +2094,12 @@ _edje_entry_set_cursor_end(Edje_Real_Part *rp)
Entry *en = rp->entry_data;
if (!en) return;
_curs_end(en->cursor, rp->object, en);
#ifdef HAVE_ECORE_IMF
if (en->imf_context)
ecore_imf_context_cursor_position_set(en->imf_context,
evas_textblock_cursor_pos_get(en->cursor));
#endif
}
void