use style generic call in test and fix up freeing of style string.
authorCarsten Haitzler <raster@rasterman.com>
Thu, 23 Apr 2009 04:10:43 +0000 (04:10 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Thu, 23 Apr 2009 04:10:43 +0000 (04:10 +0000)
SVN revision: 40320

src/bin/test.c
src/lib/elm_widget.c

index 4ec3361..48cee8d 100644 (file)
@@ -569,7 +569,7 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info)
    evas_object_show(bx);
 
    hv = elm_hover_add(win);
-   elm_hover_style_set(hv, "popout");
+   elm_object_style_set(hv, "popout");
    
    bt = elm_button_add(win);
    elm_button_label_set(bt, "Button");
@@ -1815,7 +1815,7 @@ my_bt_25(void *data, Evas_Object *obj, void *event_info)
    evas_object_show(bg);
    
    inwin = elm_win_inwin_add(win);
-   elm_win_inwin_style_set(inwin, "minimal_vertical");
+   elm_object_style_set(inwin, "minimal_vertical");
    evas_object_show(inwin);
    
    lb = elm_label_add(win);
index 03dbd8f..2404a5a 100644 (file)
@@ -74,6 +74,7 @@ _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
      {
         sd->subobjs = eina_list_remove(sd->subobjs, obj);
      }
+   if (sd->style) eina_stringshare_del(sd->style);
    evas_object_smart_callback_call(sd->obj, "sub-object-del", obj);
 }
 
@@ -774,16 +775,15 @@ elm_widget_style_set(Evas_Object *obj, const char *style)
    const char *old;
    API_ENTRY return;
    old = sd->style;
-   eina_stringshare_del(sd->style);
    sd->style = eina_stringshare_add(style);
-   if (old != sd->style)
-     elm_widget_theme(obj);
+   if (old) eina_stringshare_del(old);
+   if (old != sd->style) elm_widget_theme(obj);
 }
 
 EAPI const char *
 elm_widget_style_get(const Evas_Object *obj)
 {
-   API_ENTRY return "default";
+   API_ENTRY return "";
    if (sd->style) return sd->style;
    return "default";
 }