Dear All, Hello!

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

Sincerely,
Shinwoo Kim.
Index: data/themes/widgets/ctxpopup.edc
===================================================================
--- data/themes/widgets/ctxpopup.edc	(revision 62675)
+++ data/themes/widgets/ctxpopup.edc	(working copy)
@@ -437,6 +437,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 +455,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 +473,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 +491,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 +510,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 +526,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 +542,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 +558,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 +572,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 +583,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 +595,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,12 +606,83 @@ 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 1.0;
+         target: "ctxpopup_clip";
+      }
+      program { name: "up";
+         signal: "elm,state,up";
+         source: "elm";
+         action: STATE_SET "up" 0.0;
+         transition: LINEAR 1.0;
+         target: "ctxpopup_clip";
+      }
+      program { name: "left";
+         signal: "elm,state,left";
+         source: "elm";
+         action: STATE_SET "left" 0.0;
+         transition: LINEAR 1.0;
+         target: "ctxpopup_clip";
+      }
+      program { name: "right";
+         signal: "elm,state,right";
+         source: "elm";
+         action: STATE_SET "right" 0.0;
+         transition: LINEAR 1.0;
+         target: "ctxpopup_clip";
+      }
+      program { name: "down";
+         signal: "elm,state,down";
+         source: "elm";
+         action: STATE_SET "down" 0.0;
+         transition: LINEAR 1.0;
+         target: "ctxpopup_clip";
+      }
+   }
 }
 ///////////////////////////////////////////////////////////////////////////////
 group { name: "elm/ctxpopup/arrow/default";
Index: src/lib/elc_ctxpopup.c
===================================================================
--- src/lib/elc_ctxpopup.c	(revision 62675)
+++ src/lib/elc_ctxpopup.c	(working copy)
@@ -445,6 +445,7 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_R
                          (hover_area.x + hover_area.w));
                }
           }
+
      }
 
    //Final position and size.
@@ -457,6 +458,33 @@ _calc_base_geometry(Evas_Object *obj, Evas_Coord_R
 }
 
 static void
+_transition_adjust(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,up", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_LEFT:
+           edje_object_signal_emit(wd->base, "elm,state,left", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_RIGHT:
+           edje_object_signal_emit(wd->base, "elm,state,right", "elm");
+           break;
+        case ELM_CTXPOPUP_DIRECTION_DOWN:
+           edje_object_signal_emit(wd->base, "elm,state,down", "elm");
+           break;
+        default:
+           break;
+     }
+}
+
+static void
 _update_arrow(Evas_Object *obj, Elm_Ctxpopup_Direction dir)
 {
    Evas_Coord x, y;
@@ -580,6 +608,7 @@ _sizing_eval(Evas_Object *obj)
 
    //Base
    wd->dir = _calc_base_geometry(obj, &rect);
+   _transition_adjust(obj, wd->dir);
    _update_arrow(obj, wd->dir);
    _shift_base_by_arrow(wd->arrow, wd->dir, &rect);
 
@@ -805,6 +834,7 @@ _ctxpopup_show(void *data __UNUSED__, Evas *e __UN
    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);
 }
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to