seoz pushed a commit to branch master.

commit 1286b98c1f52a070c09c2541ce8ab86fa90325dc
Author: Daniel Juyung Seo <[email protected]>
Date:   Wed Aug 28 19:31:40 2013 +0900

    elm_bg: added a color reset feature.
    
    This can be achieved by calling elm_bg_color_set(bg, -1, -1, -1);
---
 ChangeLog               | 4 ++++
 NEWS                    | 1 +
 src/lib/elm_bg.c        | 7 +++++++
 src/lib/elm_bg_legacy.h | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 55722ef..4c59fdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1577,3 +1577,7 @@
 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
--- 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:
 
diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c
index aca3ef6..9036fd6 100644
--- a/src/lib/elm_bg.c
+++ b/src/lib/elm_bg.c
@@ -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
diff --git a/src/lib/elm_bg_legacy.h b/src/lib/elm_bg_legacy.h
index aac17c8..c363f12 100644
--- a/src/lib/elm_bg_legacy.h
+++ b/src/lib/elm_bg_legacy.h
@@ -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

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to