forked from enlightenment/efl
From: cnook <kimcinoo@gmail.com>
Subject: Re: [E-devel] [Patch][CtxPopup] Add Arrow on the drag-able area of Base 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. SVN revision: 59911
This commit is contained in:
parent
45eaf731bd
commit
fc1fae8eb0
|
@ -7980,7 +7980,7 @@ collections {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "elm.swallow.arrowUp";
|
part { name: "elm.swallow.arrow_up";
|
||||||
type: SWALLOW;
|
type: SWALLOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
|
@ -7994,14 +7994,9 @@ collections {
|
||||||
min: 40 40;
|
min: 40 40;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
visible: 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;
|
type: SWALLOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
|
@ -8015,14 +8010,9 @@ collections {
|
||||||
min: 40 40;
|
min: 40 40;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
visible: 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;
|
type: SWALLOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
|
@ -8036,14 +8026,9 @@ collections {
|
||||||
min: 40 40;
|
min: 40 40;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
visible: 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;
|
type: SWALLOW;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
|
@ -8057,11 +8042,6 @@ collections {
|
||||||
min: 40 40;
|
min: 40 40;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
visible: 1;
|
visible: 1;
|
||||||
align: 0 0.5;
|
|
||||||
rel1 {
|
|
||||||
relative: 1 0;
|
|
||||||
to: "arrow_area_right";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "base";
|
part { name: "base";
|
||||||
|
|
|
@ -484,79 +484,55 @@ _update_arrow(Evas_Object *obj, Elm_Ctxpopup_Direction dir)
|
||||||
{
|
{
|
||||||
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
||||||
edje_object_signal_emit(wd->arrow, "elm,state,left", "elm");
|
edje_object_signal_emit(wd->arrow, "elm,state,left", "elm");
|
||||||
|
edje_object_part_swallow(wd->base, "elm.swallow.arrow_left", wd->arrow);
|
||||||
// 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);
|
|
||||||
if (base_size.h > 0)
|
if (base_size.h > 0)
|
||||||
{
|
{
|
||||||
if (y - base_size.y < 0) y = 0;
|
if (y < (arrow_size.h * 0.5) + base_size.y) y = 0;
|
||||||
else if (y > base_size.y + base_size.h) y = base_size.h;
|
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;
|
else y = y - base_size.y - (arrow_size.h * 0.5);
|
||||||
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowLeft", 0.5,
|
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_left", 0.5,
|
||||||
(double) (y) / (double) (base_size.h));
|
(double) (y) / (double) (base_size.h - arrow_size.h));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
||||||
edje_object_signal_emit(wd->arrow, "elm,state,right", "elm");
|
edje_object_signal_emit(wd->arrow, "elm,state,right", "elm");
|
||||||
|
edje_object_part_swallow(wd->base, "elm.swallow.arrow_right", wd->arrow);
|
||||||
// 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);
|
|
||||||
if (base_size.h > 0)
|
if (base_size.h > 0)
|
||||||
{
|
{
|
||||||
if (y -base_size.y < 0) y = 0;
|
if (y < (arrow_size.h * 0.5) + base_size.y) y = 0;
|
||||||
else if (y > base_size.y + base_size.h) y = base_size.h;
|
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;
|
else y = y - base_size.y - (arrow_size.h * 0.5);
|
||||||
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowRight", 0.5,
|
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_right", 0.5,
|
||||||
(double) (y) / (double) (base_size.h));
|
(double) (y) / (double) (base_size.h - arrow_size.h));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ELM_CTXPOPUP_DIRECTION_UP:
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
||||||
edje_object_signal_emit(wd->arrow, "elm,state,top", "elm");
|
edje_object_signal_emit(wd->arrow, "elm,state,top", "elm");
|
||||||
|
edje_object_part_swallow(wd->base, "elm.swallow.arrow_up", wd->arrow);
|
||||||
// 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);
|
|
||||||
if (base_size.w > 0)
|
if (base_size.w > 0)
|
||||||
{
|
{
|
||||||
if (x - base_size.x < 0) x = 0;
|
if (x < (arrow_size.w * 0.5) + base_size.x) x = 0;
|
||||||
else if (x > base_size.x + base_size.w) x = base_size.w;
|
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;
|
else x = x - base_size.x - (arrow_size.w * 0.5);
|
||||||
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowUp",
|
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_up",
|
||||||
(double) (x) / (double) (base_size.w), 0.5);
|
(double) (x) / (double) (base_size.w - arrow_size.w), 0.5);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
||||||
edje_object_signal_emit(wd->arrow, "elm,state,bottom", "elm");
|
edje_object_signal_emit(wd->arrow, "elm,state,bottom", "elm");
|
||||||
|
edje_object_part_swallow(wd->base, "elm.swallow.arrow_down", wd->arrow);
|
||||||
// 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);
|
|
||||||
if (base_size.w > 0)
|
if (base_size.w > 0)
|
||||||
{
|
{
|
||||||
if (x - base_size.x < 0) x = 0;
|
if (x < (arrow_size.w * 0.5) + base_size.x) x = 0;
|
||||||
else if (x > base_size.x + base_size.w) x = base_size.w;
|
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;
|
else x = x - base_size.x - (arrow_size.w * 0.5);
|
||||||
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrowDown",
|
edje_object_part_drag_value_set(wd->base, "elm.swallow.arrow_down",
|
||||||
(double) (x) / (double) (base_size.w), 0.5);
|
(double) (x) / (double) (base_size.w - arrow_size.w), 0.5);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if user does not use dragable part
|
|
||||||
evas_object_move(wd->arrow, arrow_size.x, arrow_size.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue