From d44adcfa43405e7fcc870dcf800f166ea1b2b186 Mon Sep 17 00:00:00 2001 From: Taehyub Kim Date: Tue, 24 Nov 2020 14:05:57 +0900 Subject: [PATCH] elc_popup: override color class function for applying tizen color class feature popup main_layout is not a resize object of popup. so when elm_layout_edje_get(popup) is called, popup resize object cannot be returned. This makes tizen color class feature not working. so forwarding edje object of popup main_layout when color class api is called. Change-Id: Idfd37cf1e6ed2907a305c0343685b95cc5ef0b67 --- src/lib/elementary/elc_popup.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index ec93ae5..73e6aaf 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -2213,10 +2213,6 @@ _elm_popup_efl_canvas_group_group_add(Eo *obj, Elm_Popup_Data *priv) elm_widget_style_get(obj))) CRI("Failed to set layout!"); - // TIZEN_ONLY_FEATURE: apply Tizen's color_class feature for popup - evas_object_data_set(obj, "popup_layout_edje", elm_layout_edje_get(priv->main_layout)); - // - /*********************************************************************************** * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. * ***********************************************************************************/ @@ -2763,6 +2759,35 @@ _notify_style_set(Evas_Object *obj, const char *style) return EFL_UI_THEME_APPLY_ERROR_GENERIC; } + +static Eina_Bool +_elm_popup_class_color_set(Eo *obj, Elm_Popup_Data *sd EINA_UNUSED, const char *color_class, int r, int g, int b, int a) +{ + Evas_Object *edje; + Eina_Bool int_ret = EINA_TRUE; + + edje = elm_layout_edje_get(sd->main_layout); + int_ret &= _elm_widget_color_class_set_internal(obj, edje, color_class, + r, g, b, a, + -1, -1, -1, -1, + -1, -1, -1, -1); + return int_ret; +} + +static Eina_Bool +_elm_popup_class_color_get(Eo *obj, Elm_Popup_Data *sd EINA_UNUSED, const char *color_class, int *r, int *g, int *b, int *a) +{ + Evas_Object *edje; + Eina_Bool int_ret = EINA_TRUE; + + edje = elm_layout_edje_get(obj); + int_ret &= _elm_widget_color_class_get_internal(obj, edje, color_class, + r, g, b, a, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL); + return int_ret; +} + /* END */ /* Standard widget overrides */ @@ -2785,7 +2810,9 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, Elm_Popup_Data) #define ELM_POPUP_EXTRA_OPS \ EFL_CANVAS_GROUP_CALC_OPS(elm_popup), \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup) + EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup), \ + EFL_OBJECT_OP_FUNC(elm_widget_class_color_set, _elm_popup_class_color_set), \ + EFL_OBJECT_OP_FUNC(elm_widget_class_color_get, _elm_popup_class_color_get) #include "elm_popup_eo.c" #include "elm_popup_item_eo.c" -- 2.7.4