diff options
author | Daniel Hirt <hirt.danny@gmail.com> | 2017-01-12 18:01:52 +0200 |
---|---|---|
committer | Daniel Hirt <hirt.danny@gmail.com> | 2017-01-12 18:15:10 +0200 |
commit | 50c9d1aeaa9172e4b6492eabd0da49aafd3523bb (patch) | |
tree | 77669c11675fff7be54302dfe824d56f1cdd7752 /src | |
parent | 251f52006fc5b73fbe27b89ad65688ef906c7869 (diff) |
Ui text: fix deletion of the swallowed text object
The Efl.Canvas.Text object loses its parent due to a specific behavior
of Edje when swallowing objects.
The mentioned object then loses sync with the Ui.Text object, thus not
getting deleted upon destruction - that's actually because Edje
reparents to the canvas upon its own deletion.
Adding this fix until we figure out if there is a better alternative.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/elementary/efl_ui_text.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 5a27de9747..d2414364db 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c | |||
@@ -37,6 +37,7 @@ struct _Efl_Ui_Text_Data | |||
37 | Evas_Object *mgf_bg; | 37 | Evas_Object *mgf_bg; |
38 | Evas_Object *mgf_clip; | 38 | Evas_Object *mgf_clip; |
39 | Evas_Object *mgf_proxy; | 39 | Evas_Object *mgf_proxy; |
40 | Eo *text_obj; | ||
40 | Eo *cursor; | 41 | Eo *cursor; |
41 | Eo *cursor_bidi; | 42 | Eo *cursor_bidi; |
42 | Evas_Object *start_handler; | 43 | Evas_Object *start_handler; |
@@ -1072,22 +1073,24 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) | |||
1072 | 1073 | ||
1073 | evas_object_geometry_get(obj, NULL, NULL, &resw, &resh); | 1074 | evas_object_geometry_get(obj, NULL, NULL, &resw, &resh); |
1074 | 1075 | ||
1075 | |||
1076 | if (!sd->changed && (sd->last_w == resw)) | 1076 | if (!sd->changed && (sd->last_w == resw)) |
1077 | { | 1077 | { |
1078 | if (sd->scroll) | 1078 | if (sd->scroll) |
1079 | { | 1079 | { |
1080 | Evas_Coord vw = 0, vh = 0, h = 0; | 1080 | if (sd->text_obj) |
1081 | { | ||
1082 | Evas_Coord vw = 0, vh = 0, h = 0; | ||
1081 | 1083 | ||
1082 | // Called for line wrapping + scrolling; use the viewport | 1084 | // Called for line wrapping + scrolling; use the viewport |
1083 | // width and the formatted height as proper constraints. | 1085 | // width and the formatted height as proper constraints. |
1084 | elm_interface_scrollable_content_viewport_geometry_get | 1086 | elm_interface_scrollable_content_viewport_geometry_get |
1085 | (obj, NULL, NULL, &vw, &vh); | 1087 | (obj, NULL, NULL, &vw, &vh); |
1086 | 1088 | ||
1087 | efl_canvas_text_size_formatted_get(obj, NULL, &h); | 1089 | efl_canvas_text_size_formatted_get(sd->text_obj, NULL, &h); |
1088 | if (vh > h) h = vh; | 1090 | if (vh > h) h = vh; |
1089 | 1091 | ||
1090 | evas_object_resize(sd->entry_edje, vw, h); | 1092 | evas_object_resize(sd->entry_edje, vw, h); |
1093 | } | ||
1091 | } | 1094 | } |
1092 | return; | 1095 | return; |
1093 | } | 1096 | } |
@@ -2880,6 +2883,7 @@ _efl_ui_text_elm_layout_text_get(Eo *obj, Efl_Ui_Text_Data *sd, const char *item | |||
2880 | { | 2883 | { |
2881 | const char *text; | 2884 | const char *text; |
2882 | Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); | 2885 | Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); |
2886 | sd->text_obj = text_obj; | ||
2883 | 2887 | ||
2884 | if (item) | 2888 | if (item) |
2885 | { | 2889 | { |
@@ -3527,6 +3531,10 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) | |||
3527 | evas_object_event_callback_del_full(sd->entry_edje, EVAS_CALLBACK_MOVE, | 3531 | evas_object_event_callback_del_full(sd->entry_edje, EVAS_CALLBACK_MOVE, |
3528 | _efl_ui_text_move_cb, obj); | 3532 | _efl_ui_text_move_cb, obj); |
3529 | 3533 | ||
3534 | // XXX: explicitly delete the object, as it's been reparented to the canvas, due to | ||
3535 | // a specific behavior of SWALLOW parts. | ||
3536 | efl_del(sd->text_obj); | ||
3537 | sd->text_obj = NULL; | ||
3530 | efl_canvas_group_del(efl_super(obj, MY_CLASS)); | 3538 | efl_canvas_group_del(efl_super(obj, MY_CLASS)); |
3531 | } | 3539 | } |
3532 | 3540 | ||