elementary entry: keep style user when new theme is applied 15/187115/1
authorYoungbok Shin <youngb.shin@samsung.com>
Mon, 20 Aug 2018 06:05:12 +0000 (15:05 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Mon, 20 Aug 2018 06:06:27 +0000 (15:06 +0900)
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 <cedric@osg.samsung.com>
src/lib/elm_entry.c

index e35a78b..4047788 100644 (file)
@@ -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 */