Merge "[ctxpopup] workaround for clicked item focus problem"
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Wed, 23 Feb 2011 08:58:41 +0000 (17:58 +0900)
committerGerrit Code Review <git@Taebaek>
Wed, 23 Feb 2011 08:58:41 +0000 (17:58 +0900)
src/lib/Elementary.h.in
src/lib/elm_bg.c
src/lib/elm_scroller.c

index d495c13..9d5a072 100644 (file)
@@ -588,6 +588,7 @@ extern "C" {
    EAPI void          elm_bg_overlay_set(Evas_Object *obj, Evas_Object *overlay) EINA_ARG_NONNULL(1);
    EAPI Evas_Object  *elm_bg_overlay_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI Evas_Object  *elm_bg_overlay_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EAPI void          elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
    /* smart callbacks called:
     */
 
index 5312615..7dfd466 100644 (file)
@@ -16,6 +16,9 @@ struct _Widget_Data
    Evas_Object *base, *rect, *img, *overlay;
    const char  *file, *group;
    Elm_Bg_Option option;
+   struct {
+      Evas_Coord w, h;
+   } load_opts;
 };
 
 static const char *widtype = NULL;
@@ -183,8 +186,8 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
 
    if (wd->img)
      {
-       evas_object_del(wd->img);
-       wd->img = NULL;
+        evas_object_del(wd->img);
+        wd->img = NULL;
      }
    if (!file)
      {
@@ -198,13 +201,15 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
    eina_stringshare_replace(&wd->group, group);
    if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
      {
-       wd->img = edje_object_add(evas_object_evas_get(wd->base));
-       edje_object_file_set(wd->img, file, group);
+        wd->img = edje_object_add(evas_object_evas_get(wd->base));
+        edje_object_file_set(wd->img, file, group);
      }
    else
      {
-       wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
-       evas_object_image_file_set(wd->img, file, group);
+        wd->img = evas_object_image_add(evas_object_evas_get(wd->base));
+        if ((wd->load_opts.w > 0) && (wd->load_opts.h > 0))
+           evas_object_image_load_size_set(wd->img, wd->load_opts.w, wd->load_opts.h);
+        evas_object_image_file_set(wd->img, file, group);
      }
    evas_object_repeat_events_set(wd->img, EINA_TRUE);
    edje_object_part_swallow(wd->base, "elm.swallow.background", wd->img);
index 6faef1f..5ee7efb 100644 (file)
@@ -35,7 +35,6 @@ typedef struct _Widget_Data Widget_Data;
 
 struct _Widget_Data
 {
-   Evas_Coord wx, wy, ww, wh; /* Last "wanted" geometry */
    Evas_Object *scr;
    Evas_Object *content;
    const char *widget_name, *widget_base;
@@ -249,9 +248,13 @@ _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *so
 static void
 _show_region_hook(void *data, Evas_Object *obj)
 {
-   Evas_Coord x, y, w, h;
-   elm_widget_show_region_get(obj, &x, &y, &w, &h);
-   elm_scroller_region_show(data, x, y, w, h);
+   Widget_Data *wd = elm_widget_data_get(data);  
+   Evas_Coord x, y, w, h;  
+   if (!wd) return;  
+   elm_widget_show_region_get(obj, &x, &y, &w, &h);  
+   elm_scroller_region_show(data, x, y, w, h);  
+   if (wd->scr)  
+      elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);  
 }
 
 static void
@@ -296,7 +299,6 @@ _sizing_eval(Evas_Object *obj)
         if ((maxw > 0) && (w > maxw)) w = maxw;
         if ((maxh > 0) && (h > maxh)) h = maxh;
         evas_object_size_hint_min_set(obj, w, h);
-        elm_smart_scroller_child_region_show(wd->scr, wd->wx, wd->wy, wd->ww, wd->wh);
      }
 }
 
@@ -529,7 +531,6 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
    if (!wd) return;
    if (wd->content == content) return;
    if (wd->content) evas_object_del(wd->content);
-   wd->wx = wd->wh = wd->ww = wd->wy = 0;
 
    wd->content = content;
    if (content)
@@ -655,10 +656,6 @@ elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coor
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if ((!wd) || (!wd->scr)) return;
-   wd->wx = x;
-   wd->wh = h;
-   wd->ww = w;
-   wd->wy = y;
 
    elm_smart_scroller_child_region_show(wd->scr, x, y, w, h);
 }
@@ -877,10 +874,7 @@ elm_scroller_region_bring_in(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if ((!wd) || (!wd->scr)) return;
-   wd->wx = x;
-   wd->wh = h;
-   wd->ww = w;
-   wd->wy = y;
+
    elm_smart_scroller_region_bring_in(wd->scr, x, y, w, h);
 }