summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_bg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/efl_ui_bg.c')
-rw-r--r--src/lib/elementary/efl_ui_bg.c53
1 files changed, 33 insertions, 20 deletions
diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c
index a3838b7..3a38c4a 100644
--- a/src/lib/elementary/efl_ui_bg.c
+++ b/src/lib/elementary/efl_ui_bg.c
@@ -98,6 +98,9 @@ EOLIAN static void
98_efl_ui_bg_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Bg_Data *priv) 98_efl_ui_bg_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Bg_Data *priv)
99{ 99{
100 100
101 priv->rect = evas_object_rectangle_add(evas_object_evas_get(obj));
102 evas_object_color_set(priv->rect, 0, 0, 0, 0);
103
101 efl_canvas_group_add(efl_super(obj, MY_CLASS)); 104 efl_canvas_group_add(efl_super(obj, MY_CLASS));
102 elm_widget_sub_object_parent_add(obj); 105 elm_widget_sub_object_parent_add(obj);
103 elm_widget_can_focus_set(obj, EINA_FALSE); 106 elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -108,6 +111,7 @@ _efl_ui_bg_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Bg_Data *priv)
108 111
109 if (!elm_layout_theme_set(obj, "bg", "base", elm_widget_style_get(obj))) 112 if (!elm_layout_theme_set(obj, "bg", "base", elm_widget_style_get(obj)))
110 CRI("Failed to set layout!"); 113 CRI("Failed to set layout!");
114 elm_layout_content_set(obj, "elm.swallow.rectangle", priv->rect);
111} 115}
112 116
113EAPI Evas_Object * 117EAPI Evas_Object *
@@ -129,6 +133,20 @@ _efl_ui_bg_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Data *_pd EINA_UNUSED)
129 return obj; 133 return obj;
130} 134}
131 135
136/* FIXME: Efl.Canvas.group_member_add in Elm.Widget sets child's colors as the same
137 * with that of obj. The color of resize_obj of Bg should not be changed
138 * because actual color is the color of rectangle in resize_obj.
139 */
140EOLIAN static void
141_efl_ui_bg_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Bg_Data *_pd EINA_UNUSED, Evas_Object *child)
142{
143 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), child);
144 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
145
146 if (wd->resize_obj == child)
147 evas_object_color_set(child, 255, 255, 255, 255);
148}
149
132EOLIAN static Eina_Bool 150EOLIAN static Eina_Bool
133_efl_ui_bg_efl_file_file_set(Eo *obj, Efl_Ui_Bg_Data *sd, const char *file, const char *group) 151_efl_ui_bg_efl_file_file_set(Eo *obj, Efl_Ui_Bg_Data *sd, const char *file, const char *group)
134{ 152{
@@ -265,31 +283,20 @@ elm_bg_color_set(Evas_Object *obj,
265 int g, 283 int g,
266 int b) 284 int b)
267{ 285{
286 int a = 255;
268 EFL_UI_BG_CHECK(obj); 287 EFL_UI_BG_CHECK(obj);
269 efl_gfx_color_set(obj, r, g, b, 255);
270}
271
272EOLIAN static void
273_efl_ui_bg_efl_gfx_color_set(Eo *obj, Efl_Ui_Bg_Data *sd, int r, int g, int b, int a)
274{
275 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
276 288
277 // reset color 289 // reset color
278 if ((r == -1) && (g == -1) && (b == -1)) 290 if ((r == -1) && (g == -1) && (b == -1))
279 { 291 {
280 ELM_SAFE_FREE(sd->rect, evas_object_del); 292 r = g = b = a = 0;
281 return; 293 }
282 } 294 efl_gfx_color_set(obj, r, g, b, a);
283 295}
284 if (!sd->rect)
285 {
286 sd->rect = evas_object_rectangle_add
287 (evas_object_evas_get(wd->resize_obj));
288 efl_gfx_visible_set(sd->rect, EINA_TRUE);
289 elm_layout_content_set(obj, "elm.swallow.rectangle", sd->rect);
290 elm_layout_sizing_eval(obj);
291 }
292 296
297EOLIAN static void
298_efl_ui_bg_efl_gfx_color_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, int r, int g, int b, int a)
299{
293 evas_object_color_set(sd->rect, r, g, b, a); 300 evas_object_color_set(sd->rect, r, g, b, a);
294} 301}
295 302
@@ -303,6 +310,12 @@ elm_bg_color_get(const Evas_Object *obj,
303 efl_gfx_color_get((Eo *) obj, r, g, b, NULL); 310 efl_gfx_color_get((Eo *) obj, r, g, b, NULL);
304} 311}
305 312
313EOLIAN static void
314_efl_ui_bg_efl_gfx_color_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, int *r, int *g, int *b, int *a)
315{
316 evas_object_color_get(sd->rect, r, g, b, a);
317}
318
306EAPI void 319EAPI void
307elm_bg_load_size_set(Evas_Object *obj, int w, int h) 320elm_bg_load_size_set(Evas_Object *obj, int w, int h)
308{ 321{