diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2012-06-26 11:35:45 +0000 |
---|---|---|
committer | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2012-06-26 11:35:45 +0000 |
commit | 2aba767650ec1f97a55096c4411d8bc1ebdccf8f (patch) | |
tree | 3b93f94dc40d41a42f37d305c2de83d9bf04bd0d /src/bin | |
parent | 1e5628a2a3ef2667124ee13c7dc3d2ae681dd4ad (diff) | |
download | enlightenment-2aba767650ec1f97a55096c4411d8bc1ebdccf8f.tar.gz |
formatting
SVN revision: 72875
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/e_gadcon_popup.c | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/src/bin/e_gadcon_popup.c b/src/bin/e_gadcon_popup.c index 0db035703a..bf6d2af96b 100644 --- a/src/bin/e_gadcon_popup.c +++ b/src/bin/e_gadcon_popup.c @@ -48,14 +48,14 @@ e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o) old_o = edje_object_part_swallow_get(pop->o_bg, "e.swallow.content"); if (old_o != o) { - if (old_o) - { - edje_object_part_unswallow(pop->o_bg, old_o); - evas_object_del(old_o); - } - edje_object_part_swallow(pop->o_bg, "e.swallow.content", o); - evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _e_gadcon_popup_changed_size_hints_cb, pop); + if (old_o) + { + edje_object_part_unswallow(pop->o_bg, old_o); + evas_object_del(old_o); + } + edje_object_part_swallow(pop->o_bg, "e.swallow.content", o); + evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _e_gadcon_popup_changed_size_hints_cb, pop); } _e_gadcon_popup_size_recalc(pop, o); @@ -96,13 +96,13 @@ e_gadcon_popup_toggle_pinned(E_Gadcon_Popup *pop) if (pop->pinned) { - pop->pinned = 0; - edje_object_signal_emit(pop->o_bg, "e,state,unpinned", "e"); + pop->pinned = 0; + edje_object_signal_emit(pop->o_bg, "e,state,unpinned", "e"); } else { - pop->pinned = 1; - edje_object_signal_emit(pop->o_bg, "e,state,pinned", "e"); + pop->pinned = 1; + edje_object_signal_emit(pop->o_bg, "e,state,pinned", "e"); } } @@ -152,8 +152,8 @@ _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj) if ((!w) || (!h)) evas_object_size_hint_min_get(obj, &w, &h); if ((!w) || (!h)) { - edje_object_size_min_get(obj, &w, &h); - edje_object_size_min_restricted_calc(obj, &w, &h, w, h); + edje_object_size_min_get(obj, &w, &h); + edje_object_size_min_restricted_calc(obj, &w, &h, w, h); } edje_extern_object_min_size_set(obj, w, h); edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h); @@ -179,53 +179,58 @@ _e_gadcon_popup_position(E_Gadcon_Popup *pop) case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_RIGHT: - px = gx - pop->w; - py = gy; - if (py + pop->h >= (zy + zh)) - py = gy + gh - pop->h; - break; + px = gx - pop->w; + py = gy; + if (py + pop->h >= (zy + zh)) + py = gy + gh - pop->h; + break; + case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LB: - px = gx + gw; - py = gy; - if (py + pop->h >= (zy + zh)) - py = gy + gh - pop->h; - break; + px = gx + gw; + py = gy; + if (py + pop->h >= (zy + zh)) + py = gy + gh - pop->h; + break; + case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TR: - py = gy + gh; - px = (gx + (gw / 2)) - (pop->w / 2); - if ((px + pop->w) >= (zx + zw)) - px = gx + gw - pop->w; + py = gy + gh; + px = (gx + (gw / 2)) - (pop->w / 2); + if ((px + pop->w) >= (zx + zw)) + px = gx + gw - pop->w; else if (px < zx) px = zx; - break; + break; + case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BR: - py = gy - pop->h; - px = (gx + (gw / 2)) - (pop->w / 2); - if ((px + pop->w) >= (zx + zw)) - px = gx + gw - pop->w; + py = gy - pop->h; + px = (gx + (gw / 2)) - (pop->w / 2); + if ((px + pop->w) >= (zx + zw)) + px = gx + gw - pop->w; else if (px < zx) px = zx; - break; + break; + case E_GADCON_ORIENT_FLOAT: - px = (gx + (gw / 2)) - (pop->w / 2); - if (gy >= (zy + (zh / 2))) - py = gy - pop->h; - else - py = gy + gh; - if ((px + pop->w) >= (zx + zw)) - px = gx + gw - pop->w; + px = (gx + (gw / 2)) - (pop->w / 2); + if (gy >= (zy + (zh / 2))) + py = gy - pop->h; + else + py = gy + gh; + if ((px + pop->w) >= (zx + zw)) + px = gx + gw - pop->w; else if (px < zx) px = zx; - break; + break; + default: - e_popup_move_resize(pop->win, 50, 50, pop->w, pop->h); - return; + e_popup_move_resize(pop->win, 50, 50, pop->w, pop->h); + return; } if (px - zx < 0) px = zx; @@ -245,3 +250,4 @@ _e_gadcon_popup_changed_size_hints_cb(void *data, Evas *e __UNUSED__, Evas_Objec pop = data; _e_gadcon_popup_size_recalc(pop, obj); } + |