Elm map : fix bubble theme
authorJonathan Atton <jonathan.atton@gmail.com>
Sun, 15 Nov 2009 16:24:02 +0000 (16:24 +0000)
committerJonathan Atton <jonathan.atton@gmail.com>
Sun, 15 Nov 2009 16:24:02 +0000 (16:24 +0000)
SVN revision: 43713

data/themes/Makefile.am
data/themes/bubble.png
data/themes/default.edc
src/lib/elm_map.c

index a46a0a7d482e2899d7bddbade1f1c32a73228be4..41fa55d0e5dffe66b7ce2119900b9359be0f4a56 100644 (file)
@@ -76,6 +76,7 @@ cur_hi.png \
 cur_shad.png \
 cur_shine.png \
 cur_glow.png \
+bubble.png \
 bubble_3.png \
 bubble_shine3.png \
 bubble_4.png \
index ed495b03f288fdaf7b5b9d9f753c527f06b9fda7..78b831b41b3fe2ce9ee22f3dbc237ef09311223b 100644 (file)
Binary files a/data/themes/bubble.png and b/data/themes/bubble.png differ
index 4a9915a276bbd7f4871e650d5e72a7bf380a351b..83a3a382d7df76d6f6ee82c2275f8006884351e3 100644 (file)
@@ -19261,7 +19261,7 @@ collections {
         }
     parts {
     part { name: "clipper";
-        mouse_events:  0;
+        mouse_events:  1;
         description { state: "default" 0.0;
           color: 255 255 255 0;
         }
@@ -19302,12 +19302,10 @@ collections {
         description { state:    "default" 0.0;
           rel1 {
             to: "base0";
-            offset: 5 4;
           }
           rel2 {
             to: "base0";
             relative: 1.0 0.5;
-            offset: -6 -16;
           }
           image {
             normal: "bubble_shine.png";
@@ -19315,7 +19313,7 @@ collections {
           }
           fill.smooth: 0;
         }
-      }
+        }
     }
     programs {
         program { name: "show";
index b5893d19bcd324e04542f4039e0a46bb7977bf87..a16dcba430c259480003ac8aa6891156f7e8e33a 100644 (file)
@@ -76,8 +76,9 @@ struct _Marker_Group
    Eina_List *markers;
    Evas_Coord x, y;
    Evas_Coord w, h;
-   Evas_Object *obj, *bubble, *sc, *bx;
+   Evas_Object *obj, *bubble, *sc, *bx, *rect;
    Eina_Bool open : 1;
+   Eina_Bool raise : 1;
 };
 
 struct _Grid_Item
@@ -864,7 +865,7 @@ _del_pre_hook(Evas_Object *obj)
 
    Widget_Data *wd = elm_widget_data_get(obj);
    grid_clearall(obj);
-   
+
    for(i=0; i<19; i++)
      {
        EINA_LIST_FREE(wd->markers[i], group)
@@ -1102,6 +1103,24 @@ _scr_scroll(void *data, Evas_Object *obj, void *event_info)
    evas_object_smart_callback_call(data, "scroll", NULL);
 }
 
+   static void
+_group_bubble_mouse_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   Marker_Group *group = data;
+   if(group->raise)
+     {
+       group->raise = EINA_FALSE;
+       return ;
+     }
+
+   if(!evas_object_above_get(group->rect))
+     return ;
+   group->raise = EINA_TRUE;
+   evas_object_raise(group->bubble);
+   evas_object_raise(group->sc);
+   evas_object_raise(group->rect);
+}
+
    static void
 _group_bubble_create(Marker_Group *group)
 {
@@ -1116,15 +1135,17 @@ _group_bubble_create(Marker_Group *group)
 
    _group_bubble_content_update(group);
 
-   _group_bubble_place(group);
-}
+   group->rect = evas_object_rectangle_add(evas_object_evas_get(group->obj));
+   evas_object_color_set(group->rect, 0, 0, 0, 0);
+   evas_object_repeat_events_set(group->rect, EINA_TRUE);
+   evas_object_smart_member_add(group->rect,
+        group->wd->obj);
+   elm_widget_sub_object_add(group->wd->obj, group->rect);
 
-   static void
-_group_bubble_mouse_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-   Marker_Group *group = data;
-   evas_object_raise(group->bubble);
-   evas_object_raise(group->sc);
+   evas_object_event_callback_add(group->rect, EVAS_CALLBACK_MOUSE_UP, _group_bubble_mouse_in_cb, group);
+
+
+   _group_bubble_place(group);
 }
 
    static void
@@ -1155,9 +1176,6 @@ _group_bubble_content_update(Marker_Group *group)
        elm_box_horizontal_set(group->bx, EINA_TRUE);
        evas_object_show(group->bx);
 
-       evas_object_event_callback_add(group->bx, EVAS_CALLBACK_MOUSE_IN, _group_bubble_mouse_in_cb, group);
-       evas_object_event_callback_add(group->bx, EVAS_CALLBACK_MOUSE_DOWN, _group_bubble_mouse_in_cb, group);
-
        elm_scroller_content_set(group->sc, group->bx);
      }
 
@@ -1196,6 +1214,7 @@ _group_bubble_free(Marker_Group *group)
 {
    if(!group->bubble) return ;
    evas_object_del(group->bubble);
+   evas_object_del(group->rect);
    group->bubble = NULL;
    _group_bubble_content_free(group);
 }
@@ -1220,6 +1239,10 @@ _group_bubble_place(Marker_Group *group)
    evas_object_move(group->bubble, xx, yy);
    evas_object_resize(group->bubble, ww, hh);
    evas_object_show(group->bubble);
+
+   evas_object_move(group->rect, xx, yy);
+   evas_object_resize(group->rect, ww, hh);
+   evas_object_show(group->rect);
 }