Edje entry: Don't emit cursor,changed when not needed.
This includes setting the text and setting cursor position to the already set position. SVN revision: 59531
This commit is contained in:
parent
43955a6d53
commit
f13ec69e34
|
@ -97,3 +97,9 @@
|
|||
BOUNCE, SPRING (also made short name versions of the long ones
|
||||
possible too).
|
||||
|
||||
2011-05-19 Tom Hacohen (TAsn)
|
||||
|
||||
* Entry: Don't emit "cursor,changed" when setting the text, because
|
||||
the cursor really didn't change, it's more like a new cursor.
|
||||
Also, when setting position, don't do anything if position is as it
|
||||
was.
|
||||
|
|
|
@ -2035,11 +2035,14 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
|
|||
// set text as markup
|
||||
_sel_clear(en->cursor, rp->object, en);
|
||||
evas_object_textblock_text_markup_set(rp->object, text);
|
||||
_edje_entry_set_cursor_start(rp);
|
||||
|
||||
_anchors_get(en->cursor, rp->object, en);
|
||||
_edje_emit(rp->edje, "entry,changed", rp->part->name);
|
||||
#if 0
|
||||
/* Don't emit cursor changed cause it didn't. It's just init to 0. */
|
||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||
_edje_entry_set_cursor_start(rp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2057,10 +2060,6 @@ _edje_entry_text_markup_append(Edje_Real_Part *rp, const char *text)
|
|||
/* We are updating according to the real cursor on purpose */
|
||||
_anchors_get(en->cursor, rp->object, en);
|
||||
_edje_emit(rp->edje, "entry,changed", rp->part->name);
|
||||
#if 0
|
||||
/* Cursor didn't really change, don't say it did. */
|
||||
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
|
||||
#endif
|
||||
|
||||
_edje_entry_real_part_configure(rp);
|
||||
}
|
||||
|
@ -2669,6 +2668,10 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
|
|||
Entry *en = rp->entry_data;
|
||||
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
|
||||
if (!c) return;
|
||||
/* Abort if cursor position didn't really change */
|
||||
if (evas_textblock_cursor_pos_get(c) == pos)
|
||||
return;
|
||||
|
||||
evas_textblock_cursor_pos_set(c, pos);
|
||||
_sel_update(c, rp->object, rp->entry_data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue