summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/examples/evas/evas-smart-object.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/src/examples/evas/evas-smart-object.c b/src/examples/evas/evas-smart-object.c
index 2a2bd256bb..7377c4731c 100644
--- a/src/examples/evas/evas-smart-object.c
+++ b/src/examples/evas/evas-smart-object.c
@@ -196,15 +196,19 @@ _evas_smart_example_smart_add(Evas_Object *o)
196{ 196{
197 EVAS_SMART_DATA_ALLOC(o, Evas_Smart_Example_Data); 197 EVAS_SMART_DATA_ALLOC(o, Evas_Smart_Example_Data);
198 198
199 /* call parent_sc->add() before member_adding the children, otherwise the
200 * smart object's clipper won't be created yet, and the children won't be
201 * clipped to it */
202 _evas_smart_example_parent_sc->add(o);
203
199 /* this is a border around the smart object's area, delimiting it */ 204 /* this is a border around the smart object's area, delimiting it */
200 priv->border = evas_object_image_filled_add(evas_object_evas_get(o)); 205 priv->border = evas_object_image_filled_add(evas_object_evas_get(o));
201 evas_object_image_file_set(priv->border, border_img_path, NULL); 206 evas_object_image_file_set(priv->border, border_img_path, NULL);
202 evas_object_image_border_set(priv->border, 3, 3, 3, 3); 207 evas_object_image_border_set(priv->border, 3, 3, 3, 3);
203 evas_object_image_border_center_fill_set( 208 evas_object_image_border_center_fill_set(
204 priv->border, EVAS_BORDER_FILL_NONE); 209 priv->border, EVAS_BORDER_FILL_NONE);
210 evas_object_show(priv->border);
205 evas_object_smart_member_add(priv->border, o); 211 evas_object_smart_member_add(priv->border, o);
206
207 _evas_smart_example_parent_sc->add(o);
208} 212}
209 213
210static void 214static void
@@ -228,30 +232,6 @@ _evas_smart_example_smart_del(Evas_Object *o)
228} 232}
229 233
230static void 234static void
231_evas_smart_example_smart_show(Evas_Object *o)
232{
233 EVAS_SMART_EXAMPLE_DATA_GET(o, priv);
234
235 if (priv->children[0]) evas_object_show(priv->children[0]);
236 if (priv->children[1]) evas_object_show(priv->children[1]);
237 evas_object_show(priv->border);
238
239 _evas_smart_example_parent_sc->show(o);
240}
241
242static void
243_evas_smart_example_smart_hide(Evas_Object *o)
244{
245 EVAS_SMART_EXAMPLE_DATA_GET(o, priv);
246
247 if (priv->children[0]) evas_object_hide(priv->children[0]);
248 if (priv->children[1]) evas_object_hide(priv->children[1]);
249 evas_object_hide(priv->border);
250
251 _evas_smart_example_parent_sc->hide(o);
252}
253
254static void
255_evas_smart_example_smart_resize(Evas_Object *o, 235_evas_smart_example_smart_resize(Evas_Object *o,
256 Evas_Coord w, 236 Evas_Coord w,
257 Evas_Coord h) 237 Evas_Coord h)
@@ -296,8 +276,6 @@ _evas_smart_example_smart_set_user(Evas_Smart_Class *sc)
296 /* specializing these two */ 276 /* specializing these two */
297 sc->add = _evas_smart_example_smart_add; 277 sc->add = _evas_smart_example_smart_add;
298 sc->del = _evas_smart_example_smart_del; 278 sc->del = _evas_smart_example_smart_del;
299 sc->show = _evas_smart_example_smart_show;
300 sc->hide = _evas_smart_example_smart_hide;
301 279
302 /* clipped smart object has no hook on resizes or calculations */ 280 /* clipped smart object has no hook on resizes or calculations */
303 sc->resize = _evas_smart_example_smart_resize; 281 sc->resize = _evas_smart_example_smart_resize;