diff options
author | Alastair Poole <netstar@gmail.com> | 2018-05-13 17:14:01 +0100 |
---|---|---|
committer | Alastair Poole <netstar@gmail.com> | 2018-05-13 17:16:13 +0100 |
commit | a92b80ff868fa798b3b2b3a9b3cfb887598e91c3 (patch) | |
tree | 31a505fb63dbabe239e3e0ac4b8b7a7eb407e389 | |
parent | 577c00789ac47838d4288680f900a349dbfb3389 (diff) | |
download | efl-a92b80ff868fa798b3b2b3a9b3cfb887598e91c3.tar.gz |
elm_code: add EOAPI to refresh theme after a user layout change.
Hopefully this retains the object hierarchy. Gives us a method
to update the widget theme after a layout change.
-rw-r--r-- | src/lib/elementary/elm_code_widget.c | 18 | ||||
-rw-r--r-- | src/lib/elementary/elm_code_widget.eo | 3 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c index 0c62a83a03..c39ffe6f9d 100644 --- a/src/lib/elementary/elm_code_widget.c +++ b/src/lib/elementary/elm_code_widget.c @@ -2252,13 +2252,13 @@ _elm_code_widget_cursor_position_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_ *col = pd->cursor_col; } -EOLIAN static Efl_Ui_Theme_Apply -_elm_code_widget_efl_ui_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd) +EOLIAN static void +_elm_code_widget_theme_refresh(Eo *obj, Elm_Code_Widget_Data *pd) { Eo *edje; int r, g, b, a; - double fade; unsigned int i; + double fade; Evas_Object *grid; edje = elm_layout_edje_get(obj); @@ -2268,14 +2268,20 @@ _elm_code_widget_efl_ui_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd) fade = (double) pd->alpha / 255; evas_object_color_set(pd->background, r * fade, g * fade, b * fade, a * fade); - if (!efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS))) - return EFL_UI_THEME_APPLY_FAILED; - for (i = 0; i < eina_list_count(pd->grids); i++) { grid = eina_list_nth(pd->grids, i); _elm_code_widget_setup_palette(grid, obj, fade); } +} + +EOLIAN static Efl_Ui_Theme_Apply +_elm_code_widget_efl_ui_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd) +{ + if (!efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS))) + return EFL_UI_THEME_APPLY_FAILED; + + _elm_code_widget_theme_refresh(obj, pd); return EFL_UI_THEME_APPLY_SUCCESS; } diff --git a/src/lib/elementary/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo index 0f27eb6b97..a03c5b11b9 100644 --- a/src/lib/elementary/elm_code_widget.eo +++ b/src/lib/elementary/elm_code_widget.eo @@ -191,6 +191,9 @@ class Elm.Code_Widget (Efl.Ui.Layout.Object, Efl.Access.Text) col: uint; [[The horizontal position of the cursor, starting from column 1]] } } + theme_refresh { + [[Update and refresh theme for widget.]] + } line_refresh { [[Refresh code line in widget]] params { |