elm_bg: added a color reset feature.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Wed, 28 Aug 2013 10:31:40 +0000 (19:31 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Wed, 28 Aug 2013 10:35:39 +0000 (19:35 +0900)
This can be achieved by calling elm_bg_color_set(bg, -1, -1, -1);

ChangeLog
NEWS
src/lib/elm_bg.c
src/lib/elm_bg_legacy.h

index 55722ef..4c59fdc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2013-08-26  Daniel Juyung Seo (SeoZ)
 
         * Gengrid: implement selectraise feature.
+
+2013-08-28  DAniel Juyung Seo (SeoZ)
+
+        * Bg: Add bg reset feature.
diff --git a/NEWS b/NEWS
index bc866e6..c2056f3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -84,6 +84,7 @@ Additions:
    * Add _elm_access_object_get, deprecate _elm_access_info_get
    * Add elm_win_focus_highlight_animate_set/get().
    * Add selectraise feature to gengrid.
+   * Add bg reset feature.
 
 Improvements:
 
index aca3ef6..9036fd6 100644 (file)
@@ -308,6 +308,13 @@ _color_set(Eo *obj, void *_pd, va_list *list)
    Elm_Bg_Smart_Data *sd = _pd;
    Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
 
+   // reset color
+   if ((r == -1) && (g == -1) && (b == -1))
+     {
+        ELM_SAFE_FREE(sd->rect, evas_object_del);
+        return;
+     }
+
    if (!sd->rect)
      {
         sd->rect = evas_object_rectangle_add
index aac17c8..c363f12 100644 (file)
@@ -98,6 +98,8 @@ EAPI Elm_Bg_Option                elm_bg_option_get(const Evas_Object *obj);
  * previously called elm_bg_file_set(), so that you just want a solid
  * color background.
  *
+ * @note You can reset the color by setting @r, @g, @b as -1, -1, -1.
+ *
  * @see elm_bg_color_get()
  *
  * @ingroup Bg