Dear Mr. Hermet,
Hello, I have attached more accurate patch based on latest elementary. The
last patch already there.
All your review items are reflected on the attached patch.
Please review this again, sorry for any inconvenient.

Dear Mr. Raster,
Hi, Would you please let me know why you don't like the idea of swallowing?
Someday the arrow group could be a part of base group..
Previously, I had already made as you mentioned, but Hermet did not prefer
that the arrow is part of the ctxpopup(base).

Thanks!

Sincerely,
Shinwoo Kim.

2011/6/2 Carsten Haitzler <ras...@rasterman.com>

> On Fri, 27 May 2011 19:08:44 +0900 cnook <kimci...@gmail.com> said:
>
> this one is fine. though in general i dont like the idea of swallowing the
> arrows at all - should just be part of the ctxpopup design/obj directly,
> but
> thats already there and not specific to this patch :)
>
> thanks!
>
> > Dear All,
> >
> > Hi~
> >
> > If CtxPopup has elm_slider for content, the elm_slider indicator is
> covered
> > by CtxPopup arrow.
> > So, I have made a patch for resolving this issue. As the title the arrow
> > will be swallowed in the base.
> > Even though user uses his/her own style, the attached patch will work
> > properly.
> >
> > Sincerely,
> > Shinwoo Kim.
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    ras...@rasterman.com
>
>
Index: src/lib/elc_ctxpopup.c
===================================================================
--- src/lib/elc_ctxpopup.c	(revision 59898)
+++ src/lib/elc_ctxpopup.c	(working copy)
@@ -484,79 +484,55 @@
      {
       case ELM_CTXPOPUP_DIRECTION_LEFT:
          edje_object_signal_emit(wd->arrow, "elm,state,left", "elm");
-
-         // if user does not use dragable part
-         arrow_size.y = (y - (arrow_size.h * 0.5));
-         arrow_size.x = x;
-
-         edje_object_part_swallow(wd->base, "elm.swallow.arrowLeft", wd->arrow);
+         edje_object_part_swallow(wd->base, "elm.swallow.arrow_left", wd->arrow);
          if (base_size.h > 0)
            {
-              if (y - base_size.y < 0) y = 0;
-              else if (y > base_size.y + base_size.h) y = base_size.h;
-              else y = y - base_size.y;
-              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowLeft", 0.5,
-                                              (double) (y) / (double) (base_size.h));
+              if (y < (arrow_size.h * 0.5) + base_size.y) y = 0;
+              else if (y > base_size.y + base_size.h - (arrow_size.h * 0.5)) y = base_size.h - arrow_size.h;
+              else y = y - base_size.y - (arrow_size.h * 0.5);
+              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_left", 0.5,
+                                              (double) (y) / (double) (base_size.h - arrow_size.h));
           }
          break;
       case ELM_CTXPOPUP_DIRECTION_RIGHT:
          edje_object_signal_emit(wd->arrow, "elm,state,right", "elm");
-
-         // if user does not use dragable part
-         arrow_size.y = (y - (arrow_size.h * 0.5));
-         arrow_size.x = (x - arrow_size.w);
-
-         edje_object_part_swallow(wd->base, "elm.swallow.arrowRight", wd->arrow);
+         edje_object_part_swallow(wd->base, "elm.swallow.arrow_right", wd->arrow);
          if (base_size.h > 0)
             {
-               if (y -base_size.y < 0) y = 0;
-               else if (y > base_size.y + base_size.h) y = base_size.h;
-               else y = y - base_size.y;
-               edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowRight", 0.5,
-                                               (double) (y) / (double) (base_size.h));
+              if (y < (arrow_size.h * 0.5) + base_size.y) y = 0;
+              else if (y > base_size.y + base_size.h - (arrow_size.h * 0.5)) y = base_size.h - arrow_size.h;
+              else y = y - base_size.y - (arrow_size.h * 0.5);
+              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_right", 0.5,
+                                              (double) (y) / (double) (base_size.h - arrow_size.h));
             }
          break;
       case ELM_CTXPOPUP_DIRECTION_UP:
          edje_object_signal_emit(wd->arrow, "elm,state,top", "elm");
-
-         // if user does not use dragable part
-         arrow_size.x = (x - (arrow_size.w * 0.5));
-         arrow_size.y = y;
-
-         edje_object_part_swallow(wd->base, "elm.swallow.arrowUp", wd->arrow);
+         edje_object_part_swallow(wd->base, "elm.swallow.arrow_up", wd->arrow);
          if (base_size.w > 0)
            {
-              if (x - base_size.x < 0) x = 0;
-              else if (x > base_size.x + base_size.w) x = base_size.w;
-              else x = x - base_size.x;
-              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowUp",
-                                              (double) (x) / (double) (base_size.w), 0.5);
+              if (x < (arrow_size.w * 0.5) + base_size.x) x = 0;
+              else if (x > base_size.x + base_size.w - (arrow_size.w * 0.5)) x = base_size.w - arrow_size.w;
+              else x = x - base_size.x - (arrow_size.w * 0.5);
+              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_up",
+                                              (double) (x) / (double) (base_size.w - arrow_size.w), 0.5);
            }
          break;
       case ELM_CTXPOPUP_DIRECTION_DOWN:
          edje_object_signal_emit(wd->arrow, "elm,state,bottom", "elm");
-
-         // if user does not use dragable part
-         arrow_size.x = (x - (arrow_size.w * 0.5));
-         arrow_size.y = (y - arrow_size.h);
-
-         edje_object_signal_emit(wd->arrow, "elm,state,bottom", "elm");
-         edje_object_part_swallow(wd->base, "elm.swallow.arrowDown", wd->arrow);
+         edje_object_part_swallow(wd->base, "elm.swallow.arrow_down", wd->arrow);
          if (base_size.w > 0)
            {
-              if (x - base_size.x < 0) x = 0;
-              else if (x > base_size.x + base_size.w) x = base_size.w;
-              else x = x - base_size.x;
-              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowDown",
-                                              (double) (x) / (double) (base_size.w), 0.5);
+              if (x < (arrow_size.w * 0.5) + base_size.x) x = 0;
+              else if (x > base_size.x + base_size.w - (arrow_size.w * 0.5)) x = base_size.w - arrow_size.w;
+              else x = x - base_size.x - (arrow_size.w * 0.5);
+              edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_down",
+                                              (double) (x) / (double) (base_size.w - arrow_size.w), 0.5);
            }
          break;
       default:
          break;
      }
-
-   // if user does not use dragable part
-   evas_object_move(wd->arrow, arrow_size.x, arrow_size.y);
 }
 
 static void
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc	(revision 59898)
+++ data/themes/default.edc	(working copy)
@@ -7980,7 +7980,7 @@
                }
             }
          }
-         part { name: "elm.swallow.arrowUp";
+         part { name: "elm.swallow.arrow_up";
             type: SWALLOW;
             mouse_events: 0;
             scale: 1;
@@ -7994,14 +7994,9 @@
                min: 40 40;
                fixed: 1 1;
                visible: 1;
-               align: 0.5 1;
-               rel2 {
-                  relative: 1 0;
-                  to: "arrow_area_up";
-               }
             }
          }
-         part { name: "elm.swallow.arrowDown";
+         part { name: "elm.swallow.arrow_down";
             type: SWALLOW;
             mouse_events: 0;
             scale: 1;
@@ -8015,14 +8010,9 @@
                min: 40 40;
                fixed: 1 1;
                visible: 1;
-               align: 0.5 0;
-               rel1 {
-                  relative: 1 1;
-                  to: "arrow_area_down";
-               }
             }
          }
-         part { name: "elm.swallow.arrowLeft";
+         part { name: "elm.swallow.arrow_left";
             type: SWALLOW;
             mouse_events: 0;
             scale: 1;
@@ -8036,14 +8026,9 @@
                min: 40 40;
                fixed: 1 1;
                visible: 1;
-               align: 1 0.5;
-               rel2 {
-                  relative: 0 1;
-                  to: "arrow_area_left";
-               }
             }
          }
-         part { name: "elm.swallow.arrowRight";
+         part { name: "elm.swallow.arrow_right";
             type: SWALLOW;
             mouse_events: 0;
             scale: 1;
@@ -8057,11 +8042,6 @@
                min: 40 40;
                fixed: 1 1;
                visible: 1;
-               align: 0 0.5;
-               rel1 {
-                  relative: 1 0;
-                  to: "arrow_area_right";
-               }
             }
          }
          part { name: "base";
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to