forked from enlightenment/efl
Revert "elm_entry: remove unnecessary text clearing in text_set"
This reverts commit 38db4b4c03
.
This changes entry behavior that introduce enventor break.
Can't accept it until that break is reasonable.
This commit is contained in:
parent
18fd4453d0
commit
a099b6d2b3
|
@ -1811,45 +1811,10 @@ test_entry4(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
||||||
evas_object_show(win);
|
evas_object_show(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_entry_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|
||||||
void *event_info EINA_UNUSED)
|
|
||||||
{
|
|
||||||
printf("entry is changed\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ELM_ENTRY_CHUNK_SIZE 10000
|
|
||||||
static void
|
|
||||||
my_ent_set_chunk(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
||||||
{
|
|
||||||
Evas_Object *en = data;
|
|
||||||
char *buf = calloc((ELM_ENTRY_CHUNK_SIZE + 1), sizeof(char));
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < ELM_ENTRY_CHUNK_SIZE; i++)
|
|
||||||
buf[i] = '1';
|
|
||||||
|
|
||||||
printf("set %d length of text\n", ELM_ENTRY_CHUNK_SIZE);
|
|
||||||
elm_entry_entry_set(en, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
my_ent_set_long(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
||||||
{
|
|
||||||
Evas_Object *en = data;
|
|
||||||
char *buf = calloc((ELM_ENTRY_CHUNK_SIZE + 2), sizeof(char));
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < (ELM_ENTRY_CHUNK_SIZE + 1); i++)
|
|
||||||
buf[i] = '1';
|
|
||||||
|
|
||||||
printf("set %d length of text\n", ELM_ENTRY_CHUNK_SIZE + 1);
|
|
||||||
elm_entry_entry_set(en, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
test_entry5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
test_entry5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *win, *bx, *bx2, *bt, *en;
|
Evas_Object *win, *bx, *bx2, *bt, *en;
|
||||||
char buf[10];
|
|
||||||
|
|
||||||
win = elm_win_util_standard_add("entry5", "Entry 5");
|
win = elm_win_util_standard_add("entry5", "Entry 5");
|
||||||
elm_win_autodel_set(win, EINA_TRUE);
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
@ -1875,7 +1840,6 @@ test_entry5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
||||||
"good testing to see if entry widgets work as advertised."
|
"good testing to see if entry widgets work as advertised."
|
||||||
);
|
);
|
||||||
evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
|
evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
|
||||||
evas_object_smart_callback_add(en, "changed", _entry_changed_cb, NULL);
|
|
||||||
elm_box_pack_end(bx, en);
|
elm_box_pack_end(bx, en);
|
||||||
evas_object_show(en);
|
evas_object_show(en);
|
||||||
|
|
||||||
|
@ -2109,34 +2073,6 @@ test_entry5(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
||||||
elm_box_pack_end(bx, bx2);
|
elm_box_pack_end(bx, bx2);
|
||||||
evas_object_show(bx2);
|
evas_object_show(bx2);
|
||||||
|
|
||||||
bx2 = elm_box_add(win);
|
|
||||||
elm_box_horizontal_set(bx2, EINA_TRUE);
|
|
||||||
evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
|
|
||||||
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
|
||||||
snprintf(buf, 10, "set %d", ELM_ENTRY_CHUNK_SIZE);
|
|
||||||
elm_object_text_set(bt, buf);
|
|
||||||
evas_object_smart_callback_add(bt, "clicked", my_ent_set_chunk, en);
|
|
||||||
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
|
||||||
elm_box_pack_end(bx2, bt);
|
|
||||||
elm_object_focus_allow_set(bt, EINA_FALSE);
|
|
||||||
evas_object_show(bt);
|
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
|
||||||
snprintf(buf, 10, "set %d", ELM_ENTRY_CHUNK_SIZE + 1);
|
|
||||||
elm_object_text_set(bt, buf);
|
|
||||||
evas_object_smart_callback_add(bt, "clicked", my_ent_set_long, en);
|
|
||||||
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
||||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
|
||||||
elm_box_pack_end(bx2, bt);
|
|
||||||
elm_object_focus_allow_set(bt, EINA_FALSE);
|
|
||||||
evas_object_show(bt);
|
|
||||||
|
|
||||||
elm_box_pack_end(bx, bx2);
|
|
||||||
evas_object_show(bx2);
|
|
||||||
|
|
||||||
evas_object_resize(win, 320, 480);
|
evas_object_resize(win, 320, 480);
|
||||||
|
|
||||||
elm_object_focus_set(win, EINA_TRUE);
|
elm_object_focus_set(win, EINA_TRUE);
|
||||||
|
|
|
@ -3134,22 +3134,6 @@ _entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
|
||||||
memcpy(sd->append_text_left, entry, len + 1);
|
memcpy(sd->append_text_left, entry, len + 1);
|
||||||
sd->append_text_position = 0;
|
sd->append_text_position = 0;
|
||||||
sd->append_text_len = len;
|
sd->append_text_len = len;
|
||||||
/* Set text directly as amount of chunk size
|
|
||||||
* and append remain text to idler */
|
|
||||||
if (set)
|
|
||||||
{
|
|
||||||
char tmp;
|
|
||||||
tmp = sd->append_text_left[ELM_ENTRY_CHUNK_SIZE];
|
|
||||||
sd->append_text_left[ELM_ENTRY_CHUNK_SIZE] = '\0';
|
|
||||||
|
|
||||||
if (edje_object_part_text_set(sd->entry_edje, "elm.text",
|
|
||||||
sd->append_text_left))
|
|
||||||
sd->append_text_position = ELM_ENTRY_CHUNK_SIZE;
|
|
||||||
else
|
|
||||||
edje_object_part_text_set(sd->entry_edje, "elm.text", "");
|
|
||||||
|
|
||||||
sd->append_text_left[ELM_ENTRY_CHUNK_SIZE] = tmp;
|
|
||||||
}
|
|
||||||
sd->append_text_idler = ecore_idler_add(_text_append_idler, obj);
|
sd->append_text_idler = ecore_idler_add(_text_append_idler, obj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3204,6 +3188,8 @@ _elm_entry_elm_layout_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, co
|
||||||
sd->append_text_left = NULL;
|
sd->append_text_left = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Need to clear the entry first */
|
||||||
|
edje_object_part_text_set(sd->entry_edje, "elm.text", "");
|
||||||
_entry_text_append(obj, entry, EINA_TRUE);
|
_entry_text_append(obj, entry, EINA_TRUE);
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
|
Loading…
Reference in New Issue