Dear, Tom, Raster and EFL people.

After applying the previous changeset 64721, the cursor geometry is wrong
in a char-wrapped or a mixed mode entry contented in a scroller (not a
scrolled entry).
In other words, a word-wrapped entry or a scrolled entry (when
elm_entry_scrollable_set is set to TRUE) doesn't have this problem.

Because the cursor geometry that comes from the
evas_textblock_cursor_geometry_get function(en->cursor, ...) is wrong (w is
fixed to small value and h is getting bigger when text is written
horizontally), when we type texts into the entry near the top lines, entry
is scrolled to the bottom lines.

Please apply attached patch file, "entry_test.patch.txt" (patch to
elm_entry.c and test_entry.c files) and see what happens in the below test
path.

Test path : 'Elementary Test' -> 'Entry 5' -> Insert any text into the 1st
line
Result : Entry is scrolled to the bottom line so inserted texts in the 1st
line are not shown until entry is scrolled to the top


I also attached a quick patch for this problem. ("elm_entry.patch.txt")
In the patch file, I just changed the order of these 2 function calls and
now it works fine in all line wrapping mode.

   edje_object_size_min_restricted_calc(wd->ent, &fw, &fh, 0, 0);
   edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, resw, 0);

It's really weird that changing the order of calling
'edje_object_size_min_restricted_calc' functions affects the size of
textblock cursor geometry in entry.

Please look into this bug and if you find the main problem on textblock's
side, please fix it.

If it takes time to fix this, please apply the attached quick patch file
and fix it when you're available because we have some scroll issues with
entry in scroller here at this moment.

Thank you.
Index: src/lib/elm_entry.c
===================================================================
--- src/lib/elm_entry.c (revision 65568)
+++ src/lib/elm_entry.c (working copy)
@@ -579,6 +579,7 @@ _recalc_cursor_geometry(Evas_Object *obj)
         Evas_Coord cx, cy, cw, ch;
         edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
                                                   &cx, &cy, &cw, &ch);
+        printf("[%s::%d] cx(%d) cy(%d) cw(%d) ch(%d) \n", __func__, __LINE__, 
cx, cy, cw, ch);
         if (wd->cur_changed)
           {
              elm_widget_show_region_set(obj, cx, cy, cw, ch, EINA_FALSE);
@@ -651,6 +652,7 @@ _elm_deferred_recalc_job(void *data)
         Evas_Coord cx, cy, cw, ch;
         edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
                                                   &cx, &cy, &cw, &ch);
+        printf("[%s::%d] cx(%d) cy(%d) cw(%d) ch(%d) \n", __func__, __LINE__, 
cx, cy, cw, ch);
         if (wd->cur_changed)
           {
              elm_widget_show_region_set(data, cx, cy, cw, ch, EINA_FALSE);
Index: src/bin/test_entry.c
===================================================================
--- src/bin/test_entry.c        (revision 65568)
+++ src/bin/test_entry.c        (working copy)
@@ -1348,7 +1348,7 @@ test_entry4(void *data __UNUSED__, Evas_Object *ob
 void
 test_entry5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void 
*event_info __UNUSED__)
 {
-   Evas_Object *win, *bg, *bx, *bx2, *bt, *en;
+   Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *sc;
 
    win = elm_win_add(NULL, "entry5", ELM_WIN_BASIC);
    elm_win_title_set(win, "Entry 5");
@@ -1365,24 +1365,30 @@ test_entry5(void *data __UNUSED__, Evas_Object *ob
    evas_object_show(bx);
 
    en = elm_entry_add(win);
-   elm_entry_scrollable_set(en, EINA_TRUE);
    elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
    evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_entry_entry_set(en,
-                               "This is an entry widget in this window that "
-                               "uses markup like this for styling and "
-                               "formatting like this, as well as "
-                               "to refer to them this way. At the end here is 
a really long "
-                               "line to test line wrapping to see if it works. 
But just in "
-                               "case this line is not long enough I will add 
more here to "
-                               "really test it out, as Elementary really needs 
some "
-                               "good testing to see if entry widgets work as 
advertised."
+                               "This is an entry widget in this window 
that<br>"
+                               "uses markup<br> like<br> this<br> for<br> 
styling and "
+                               "formatting like <br>this, as<br> well as "
+                               "to refer<br> to<br> them<br> this way.<br> At 
the<br> end here<br> is<br> a really long "
+                               "line to test<br> line wrapping<br> to see if 
it works. But just in "
+                               "case this line<br> is not long<br> enough I 
will add more here to "
+                               "really test it<br> out, as Elementary<br> 
really needs some "
+                               "good testing<br> to see<br> if entry widgets 
work as advertised."
                                 );
    evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, 
en);
-   elm_box_pack_end(bx, en);
    evas_object_show(en);
 
+   sc = elm_scroller_add(win);
+   elm_scroller_content_set(sc, en);
+   evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_show(sc);
+   elm_box_pack_end(bx, sc);
+
+
    bx2 = elm_box_add(win);
    elm_box_horizontal_set(bx2, EINA_TRUE);
    evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0);
@@ -1635,7 +1641,7 @@ test_entry5(void *data __UNUSED__, Evas_Object *ob
    elm_box_pack_end(bx, bx2);
    evas_object_show(bx2);
 
-   evas_object_resize(win, 320, 480);
+   evas_object_resize(win, 320, 320);
 
    elm_object_focus_set(win, EINA_TRUE);
    evas_object_show(win);
Index: src/lib/elm_entry.c
===================================================================
--- src/lib/elm_entry.c (revision 65568)
+++ src/lib/elm_entry.c (working copy)
@@ -598,8 +598,8 @@ _elm_deferred_recalc_job(void *data)
    wd->deferred_recalc_job = NULL;
 
    evas_object_geometry_get(wd->ent, NULL, NULL, &resw, NULL);
+   edje_object_size_min_restricted_calc(wd->ent, &fw, &fh, 0, 0);
    edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, resw, 0);
-   edje_object_size_min_restricted_calc(wd->ent, &fw, &fh, 0, 0);
    elm_coords_finger_size_adjust(1, &fw, 1, &minh);
    wd->entmw = fw;
    wd->entmh = minh;
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to