raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=de76b3c6e4f8efa70180d87b3724935dc4bf4ce7

commit de76b3c6e4f8efa70180d87b3724935dc4bf4ce7
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Tue Dec 17 09:13:14 2013 +0900

    colorsel - allow widget to re-wrap smaller of resized down with palette on
---
 src/lib/elm_colorselector.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 046ecb8..b4fddc5 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -1245,11 +1245,33 @@ _elm_colorselector_smart_sizing_eval(Eo *obj, void 
*_pd, va_list *list EINA_UNUS
         return;
      }
 
+   evas_object_resize(sd->palette_box, minw, minh);
+   evas_object_smart_calculate(sd->palette_box);
    edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
    evas_object_size_hint_min_set(obj, minw, minh);
    evas_object_size_hint_max_set(obj, -1, -1);
 }
 
+static void
+_on_resize(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
+           Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   ELM_COLORSELECTOR_DATA_GET(obj, sd);
+
+   if ((sd->mode == ELM_COLORSELECTOR_PALETTE) ||
+       (sd->mode == ELM_COLORSELECTOR_BOTH))
+     {
+        Evas_Coord w = 0, h = 0, minw = -1;
+
+        evas_object_size_hint_min_get(obj, &minw, NULL);
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+        if ((w != sd->_w) && (w < minw))
+          elm_layout_sizing_eval(obj);
+        sd->_w = w;
+        sd->_h = h;
+     }
+}
+
 static Eina_Bool
 _on_color_long_press(void *data)
 {
@@ -1504,6 +1526,8 @@ _elm_colorselector_smart_add(Eo *obj, void *_pd, va_list 
*list EINA_UNUSED)
    priv->palette_name = eina_stringshare_add("default");
    _palette_colors_load(obj);
 
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _on_resize, NULL);
+
    /* load background edj */
    priv->col_bars_area = edje_object_add(evas_object_evas_get(obj));
    elm_widget_theme_object_set

-- 


Reply via email to