aboutsummaryrefslogtreecommitdiffstats
path: root/legacy
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2011-05-19 12:08:29 +0000
committerTom Hacohen <tom@stosb.com>2011-05-19 12:08:29 +0000
commitf13ec69e34b44d885b0962d0629de9c2221b22e5 (patch)
treef5d95bb1d4da78116d49eb482747d0bedc60e8d7 /legacy
parentEvil: (diff)
downloadefl-f13ec69e34b44d885b0962d0629de9c2221b22e5.tar.gz
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
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/ChangeLog6
-rw-r--r--legacy/edje/src/lib/edje_entry.c13
2 files changed, 14 insertions, 5 deletions
diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog
index 151250419f..d0e0c2912e 100644
--- a/legacy/edje/ChangeLog
+++ b/legacy/edje/ChangeLog
@@ -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.
diff --git a/legacy/edje/src/lib/edje_entry.c b/legacy/edje/src/lib/edje_entry.c
index b504da3b0e..316c5f3702 100644
--- a/legacy/edje/src/lib/edje_entry.c
+++ b/legacy/edje/src/lib/edje_entry.c
@@ -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);