aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_widget.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 15:17:05 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 16:12:31 +0900
commit8608e8dc7047bfe074a71e638bc44b0eec198827 (patch)
treebe21be37d6b0ccfbd92c9f76fdbf9d68c2d77d5a /src/lib/elementary/elm_widget.c
parentefl_ui_layout: create efl_ui_bg when efl_part for background is called. (diff)
downloadefl-8608e8dc7047bfe074a71e638bc44b0eec198827.tar.gz
part bg: Fix up some unnecessary complexity
See previous commit :) Note: right now the background part has a small 3d indent which comes from the legacy theme being used. This will be fixed soon.
Diffstat (limited to 'src/lib/elementary/elm_widget.c')
-rw-r--r--src/lib/elementary/elm_widget.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index c4e6823348..e629d7c700 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -5550,41 +5550,33 @@ _efl_ui_widget_part_efl_object_destructor(Eo *obj, Elm_Part_Data *pd)
/* Efl.Part end */
/* Efl.Part Bg implementation */
-EOLIAN static void
-_efl_ui_widget_part_bg_bg_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Canvas_Object *bg)
-{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Elm_Widget_Smart_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
-
- if (sd->bg == bg)
- return;
- efl_del(sd->bg);
- sd->bg = bg;
- if (!sd->bg)
- return;
-
- efl_canvas_group_member_add(pd->obj, sd->bg);
- evas_object_stack_below(sd->bg, sd->resize_obj);
- _smart_reconfigure(sd);
-}
-
-EOLIAN static Efl_Canvas_Object *
-_efl_ui_widget_part_bg_bg_get(Eo *obj, void *_pd EINA_UNUSED)
+Efl_Canvas_Object *
+_efl_ui_widget_bg_get(Elm_Widget *obj)
{
- Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
- Elm_Widget_Smart_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
+ Elm_Widget_Smart_Data *sd = efl_data_scope_get(obj, MY_CLASS);
Evas_Object *bg_obj = sd->bg;
if (!bg_obj)
{
- bg_obj = efl_add(EFL_UI_BG_CLASS, pd->obj);
- efl_ui_widget_part_bg_set(obj, bg_obj);
+ bg_obj = efl_add(EFL_UI_BG_CLASS, obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(bg_obj, NULL);
+ sd->bg = bg_obj;
+ efl_canvas_group_member_add(obj, sd->bg);
+ evas_object_stack_below(sd->bg, sd->resize_obj);
+ _smart_reconfigure(sd);
}
return bg_obj;
}
+static inline Efl_Canvas_Object *
+efl_ui_widget_part_bg_get(Eo *part_obj)
+{
+ Elm_Part_Data *pd = efl_data_scope_get(part_obj, EFL_UI_WIDGET_PART_CLASS);
+ return _efl_ui_widget_bg_get(pd->obj);
+}
+
EOLIAN static Eina_Bool
_efl_ui_widget_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file, const char *key)
{