From b2d11f4853c5451a7f41d8bb3313eca366e9fa92 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Mon, 20 Aug 2018 15:05:12 +0900 Subject: [PATCH] elementary entry: keep style user when new theme is applied Summary: The style user should be kept when entry's mode is changed. @fix Test Plan: 1. Run "elementary_test -to "entry style user" 2. Click "Singleline Mode" toggle 3. See the result Reviewers: raster, tasn, herdsman, cedric Reviewed By: cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D4366 Change-Id: I5521d4c13b4a14ebdeb0259e754c49519ff0051c Signed-off-by: Cedric BAIL --- src/lib/elm_entry.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index e35a78b..4047788 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1793,6 +1793,7 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) { const char *str; const char *t; + const char *stl_user; const char *style = elm_widget_style_get(obj); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ELM_THEME_APPLY_FAILED); @@ -1818,6 +1819,8 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) _mirrored_set(obj, elm_widget_mirrored_get(obj)); + stl_user = eina_stringshare_add(edje_object_part_text_style_user_peek(sd->entry_edje, "elm.text")); + // TIZEN_ONLY(20150519): when password mode is enabled, elm_object_text_get returns utf8 string. elm_entry_imf_context_reset(obj); if (sd->password) @@ -1842,6 +1845,9 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) edje_object_part_text_select_allow_set (sd->entry_edje, "elm.text", EINA_FALSE); + edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", stl_user); + eina_stringshare_del(stl_user); + /* TIZEN_ONLY(20171227): fix cursor position initialization issues when theme is changed */ int cursor_pos = sd->cursor_pos; /* END */ -- 2.7.4