elementary/ctxpopup - added show effect (patched by kimcinoo@gmail.com>
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Aug 2011 07:02:26 +0000 (07:02 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 24 Aug 2011 07:02:26 +0000 (07:02 +0000)
Dear All, Hello!

The transition effect is added to the ctxpopup when it comes.
Please review the attached patch. Thanks always!

Sincerely,
Shinwoo Kim.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@62735 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

data/themes/widgets/ctxpopup.edc
src/lib/elc_ctxpopup.c

index 71affc6..b97a755 100644 (file)
@@ -417,6 +417,7 @@ group { name: "elm/ctxpopup/bg/default";
          source: "elm";
          action: STATE_SET "visible" 0.0;
          target: "ctxpopup_bg";
+         transition: LINEAR 0.25;
       }
       program { name: "hide";
          signal: "elm,state,hide";
@@ -437,6 +438,7 @@ group { name: "elm/ctxpopup/base/default";
       part { name: "arrow_area_left";
          type: RECT;
          mouse_events: 0;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             visible: 0;
             min: 20 0;
@@ -454,6 +456,7 @@ group { name: "elm/ctxpopup/base/default";
       part { name: "arrow_area_right";
          type: RECT;
          mouse_events: 0;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             visible: 0;
             min: 20 0;
@@ -471,6 +474,7 @@ group { name: "elm/ctxpopup/base/default";
       part { name: "arrow_area_up";
          type: RECT;
          mouse_events: 0;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             visible: 0;
             min: 0 20;
@@ -488,6 +492,7 @@ group { name: "elm/ctxpopup/base/default";
       part { name: "arrow_area_down";
          type: RECT;
          mouse_events: 0;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             visible: 0;
             min: 0 20;
@@ -506,6 +511,7 @@ group { name: "elm/ctxpopup/base/default";
          type: SWALLOW;
          mouse_events: 0;
          scale: 1;
+         clip_to: "ctxpopup_clip";
          dragable {
             x: 1 1 0;
             y: 1 1 0;
@@ -521,6 +527,7 @@ group { name: "elm/ctxpopup/base/default";
          type: SWALLOW;
          mouse_events: 0;
          scale: 1;
+         clip_to: "ctxpopup_clip";
          dragable {
             x: 1 1 0;
             y: 1 1 0;
@@ -536,6 +543,7 @@ group { name: "elm/ctxpopup/base/default";
          type: SWALLOW;
          mouse_events: 0;
          scale: 1;
+         clip_to: "ctxpopup_clip";
          dragable {
             x: 1 1 0;
             y: 1 1 0;
@@ -551,6 +559,7 @@ group { name: "elm/ctxpopup/base/default";
          type: SWALLOW;
          mouse_events: 0;
          scale: 1;
+         clip_to: "ctxpopup_clip";
          dragable {
             x: 1 1 0;
             y: 1 1 0;
@@ -564,6 +573,7 @@ group { name: "elm/ctxpopup/base/default";
       }
       part { name: "base";
          scale: 1;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             rel1.offset: -3 -3;
             rel2.offset: 3 3;
@@ -574,6 +584,7 @@ group { name: "elm/ctxpopup/base/default";
       }
       part { name: "over1";
          scale: 1;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             rel1.to: "base";
             rel2.to: "base";
@@ -585,6 +596,7 @@ group { name: "elm/ctxpopup/base/default";
       }
       part { name: "over2";
          scale: 1;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             rel1.to: "base";
             rel2.to: "base";
@@ -595,11 +607,82 @@ group { name: "elm/ctxpopup/base/default";
       }
       part { name: "elm.swallow.content";
          type: SWALLOW;
+         clip_to: "ctxpopup_clip";
          description { state: "default" 0.0;
             rel1 { to:"base"; offset: 4 4; }
             rel2 { to:"base"; offset: -5 -5; }
          }
       }
+      part { name: "ctxpopup_clip";
+         type: RECT;
+         description { state: "default" 0.0;
+            color: 255 255 255 0;
+            rel1 { to:"base"; relative: 0 0; }
+            rel2 { to:"base"; relative: 0 1; }
+         }
+         description { state: "up" 0.0;
+            color: 255 255 255 0;
+            rel1 { to:"arrow_area_down"; relative: 0 1; }
+            rel2 { to:"arrow_area_down"; relative: 1 1; }
+         }
+         description { state: "left" 0.0;
+            color: 255 255 255 0;
+            rel1 { to:"arrow_area_right"; relative: 1 0; }
+            rel2 { to:"arrow_area_right"; relative: 1 1; }
+         }
+         description { state: "right" 0.0;
+            color: 255 255 255 0;
+            rel1 { to:"arrow_area_left"; relative: 0 0; }
+            rel2 { to:"arrow_area_left"; relative: 0 1; }
+         }
+         description { state: "down" 0.0;
+            color: 255 255 255 0;
+            rel1 { to:"arrow_area_up"; relative: 0 0; }
+            rel2 { to:"arrow_area_up"; relative: 1 0; }
+         }
+         description { state: "visible" 0.0;
+            color: 255 255 255 255;
+            rel1 { to_x:"arrow_area_left"; to_y:"arrow_area_up"; }
+            rel2 { to_x:"arrow_area_right"; to_y:"arrow_area_down"; }
+         }
+      }
+   }
+   programs {
+      program { name: "show";
+         signal: "elm,state,show";
+         source: "elm";
+         action: STATE_SET "visible" 0.0;
+         transition: LINEAR 0.25;
+         target: "ctxpopup_clip";
+      }
+      program { name: "up";
+         signal: "elm,state,show,up";
+         source: "elm";
+         action: STATE_SET "up" 0.0;
+         transition: LINEAR 0.25;
+         target: "ctxpopup_clip";
+      }
+      program { name: "left";
+         signal: "elm,state,show,left";
+         source: "elm";
+         action: STATE_SET "left" 0.0;
+         transition: LINEAR 0.25;
+         target: "ctxpopup_clip";
+      }
+      program { name: "right";
+         signal: "elm,state,show,right";
+         source: "elm";
+         action: STATE_SET "right" 0.0;
+         transition: LINEAR 0.25;
+         target: "ctxpopup_clip";
+      }
+      program { name: "down";
+         signal: "elm,state,show,down";
+         source: "elm";
+         action: STATE_SET "down" 0.0;
+         transition: LINEAR 0.25;
+         target: "ctxpopup_clip";
+      }
    }
 }
 ///////////////////////////////////////////////////////////////////////////////
index 5218e0c..2415640 100644 (file)
@@ -539,6 +539,33 @@ _update_arrow(Evas_Object *obj, Elm_Ctxpopup_Direction dir)
 }
 
 static void
+_show_signal_emit(Evas_Object *obj, Elm_Ctxpopup_Direction dir)
+{
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || wd->visible) return;
+
+   switch (dir)
+     {
+        case ELM_CTXPOPUP_DIRECTION_UP:
+           edje_object_signal_emit(wd->base, "elm,state,show,up", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_LEFT:
+           edje_object_signal_emit(wd->base, "elm,state,show,left", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_RIGHT:
+           edje_object_signal_emit(wd->base, "elm,state,show,right", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_DOWN:
+           edje_object_signal_emit(wd->base, "elm,state,show,down", "elm");
+           break;
+        default:
+           break;
+     }
+}
+
+static void
 _sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd;
@@ -580,6 +607,7 @@ _sizing_eval(Evas_Object *obj)
 
    //Base
    wd->dir = _calc_base_geometry(obj, &rect);
+   _show_signal_emit(obj, wd->dir);
    _update_arrow(obj, wd->dir);
    _shift_base_by_arrow(wd->arrow, wd->dir, &rect);
 
@@ -805,6 +833,7 @@ _ctxpopup_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
    evas_object_show(wd->arrow);
 
    edje_object_signal_emit(wd->bg, "elm,state,show", "elm");
+   edje_object_signal_emit(wd->base, "elm,state,show", "elm");
 
    _sizing_eval(obj);
 }