summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_interface_scrollable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_interface_scrollable.c')
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c61
1 files changed, 47 insertions, 14 deletions
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 4defc70..7130efb 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -467,7 +467,7 @@ _elm_scroll_smooth_debug_shutdown(void)
467} 467}
468 468
469static void 469static void
470_elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid) 470_elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid, Eina_Bool rely_on_cache)
471{ 471{
472 Eina_Bool go_left = EINA_TRUE, go_right = EINA_TRUE; 472 Eina_Bool go_left = EINA_TRUE, go_right = EINA_TRUE;
473 Eina_Bool go_up = EINA_TRUE, go_down = EINA_TRUE; 473 Eina_Bool go_up = EINA_TRUE, go_down = EINA_TRUE;
@@ -479,11 +479,24 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
479 elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny); 479 elm_obj_pan_pos_min_get(sid->pan_obj, &minx, &miny);
480 elm_obj_pan_pos_get(sid->pan_obj, &x, &y); 480 elm_obj_pan_pos_get(sid->pan_obj, &x, &y);
481 481
482 if (x == minx) go_left = EINA_FALSE; 482 if (x <= minx) go_left = EINA_FALSE;
483 if (x == (mx + minx)) go_right = EINA_FALSE; 483 if (x >= (mx + minx)) go_right = EINA_FALSE;
484 if (y == miny) go_up = EINA_FALSE; 484 if (y <= miny) go_up = EINA_FALSE;
485 if (y == (my + miny)) go_down = EINA_FALSE; 485 if (y >= (my + miny)) go_down = EINA_FALSE;
486 if (go_left != sid->go_left) 486
487 if (sid->loop_v)
488 {
489 go_up = EINA_TRUE;
490 go_down = EINA_TRUE;
491 }
492
493 if (sid->loop_h)
494 {
495 go_right = EINA_TRUE;
496 go_left = EINA_TRUE;
497 }
498
499 if (!rely_on_cache || go_left != sid->go_left)
487 { 500 {
488 if (go_left) 501 if (go_left)
489 edje_object_signal_emit(sid->edje_obj, "elm,action,show,left", "elm"); 502 edje_object_signal_emit(sid->edje_obj, "elm,action,show,left", "elm");
@@ -491,7 +504,7 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
491 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,left", "elm"); 504 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,left", "elm");
492 sid->go_left = go_left; 505 sid->go_left = go_left;
493 } 506 }
494 if (go_right != sid->go_right) 507 if (!rely_on_cache || go_right != sid->go_right)
495 { 508 {
496 if (go_right) 509 if (go_right)
497 edje_object_signal_emit(sid->edje_obj, "elm,action,show,right", "elm"); 510 edje_object_signal_emit(sid->edje_obj, "elm,action,show,right", "elm");
@@ -499,7 +512,7 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
499 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm"); 512 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm");
500 sid->go_right= go_right; 513 sid->go_right= go_right;
501 } 514 }
502 if (go_up != sid->go_up) 515 if (!rely_on_cache ||go_up != sid->go_up)
503 { 516 {
504 if (go_up) 517 if (go_up)
505 edje_object_signal_emit(sid->edje_obj, "elm,action,show,up", "elm"); 518 edje_object_signal_emit(sid->edje_obj, "elm,action,show,up", "elm");
@@ -507,7 +520,7 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
507 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm"); 520 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm");
508 sid->go_up = go_up; 521 sid->go_up = go_up;
509 } 522 }
510 if (go_down != sid->go_down) 523 if (!rely_on_cache ||go_down != sid->go_down)
511 { 524 {
512 if (go_down) 525 if (go_down)
513 edje_object_signal_emit(sid->edje_obj, "elm,action,show,down", "elm"); 526 edje_object_signal_emit(sid->edje_obj, "elm,action,show,down", "elm");
@@ -587,6 +600,7 @@ _elm_scroll_scroll_bar_h_visibility_apply(Elm_Scrollable_Smart_Interface_Data *s
587 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,hbar", "elm"); 600 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,hbar", "elm");
588 edje_object_message_signal_process(sid->edje_obj); 601 edje_object_message_signal_process(sid->edje_obj);
589 _elm_scroll_scroll_bar_size_adjust(sid); 602 _elm_scroll_scroll_bar_size_adjust(sid);
603 _elm_direction_arrows_eval(sid, EINA_FALSE);
590 if (sid->cb_func.content_min_limit) 604 if (sid->cb_func.content_min_limit)
591 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h); 605 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h);
592} 606}
@@ -608,6 +622,7 @@ _elm_scroll_scroll_bar_v_visibility_apply(Elm_Scrollable_Smart_Interface_Data *s
608 (sid->edje_obj, "elm,action,hide,vbar", "elm"); 622 (sid->edje_obj, "elm,action,hide,vbar", "elm");
609 edje_object_message_signal_process(sid->edje_obj); 623 edje_object_message_signal_process(sid->edje_obj);
610 _elm_scroll_scroll_bar_size_adjust(sid); 624 _elm_scroll_scroll_bar_size_adjust(sid);
625 _elm_direction_arrows_eval(sid, EINA_FALSE);
611 if (sid->cb_func.content_min_limit) 626 if (sid->cb_func.content_min_limit)
612 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h); 627 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h);
613} 628}
@@ -681,7 +696,7 @@ _elm_scroll_scroll_bar_h_visibility_adjust(
681 696
682 if (scroll_h_vis_change) _elm_scroll_scroll_bar_h_visibility_apply(sid); 697 if (scroll_h_vis_change) _elm_scroll_scroll_bar_h_visibility_apply(sid);
683 698
684 _elm_direction_arrows_eval(sid); 699 _elm_direction_arrows_eval(sid, EINA_TRUE);
685 return scroll_h_vis_change; 700 return scroll_h_vis_change;
686} 701}
687 702
@@ -753,7 +768,7 @@ _elm_scroll_scroll_bar_v_visibility_adjust(
753 } 768 }
754 if (scroll_v_vis_change) _elm_scroll_scroll_bar_v_visibility_apply(sid); 769 if (scroll_v_vis_change) _elm_scroll_scroll_bar_v_visibility_apply(sid);
755 770
756 _elm_direction_arrows_eval(sid); 771 _elm_direction_arrows_eval(sid, EINA_TRUE);
757 return scroll_v_vis_change; 772 return scroll_v_vis_change;
758} 773}
759 774
@@ -1105,6 +1120,7 @@ _elm_scroll_policy_signal_emit(Elm_Scrollable_Smart_Interface_Data *sid)
1105 (sid->edje_obj, "elm,action,show_notalways,vbar", "elm"); 1120 (sid->edje_obj, "elm,action,show_notalways,vbar", "elm");
1106 edje_object_message_signal_process(sid->edje_obj); 1121 edje_object_message_signal_process(sid->edje_obj);
1107 _elm_scroll_scroll_bar_size_adjust(sid); 1122 _elm_scroll_scroll_bar_size_adjust(sid);
1123 _elm_direction_arrows_eval(sid, EINA_FALSE);
1108} 1124}
1109 1125
1110static void 1126static void
@@ -1773,7 +1789,7 @@ _elm_interface_scrollable_content_pos_set(Eo *obj, Elm_Scrollable_Smart_Interfac
1773 } 1789 }
1774 } 1790 }
1775 1791
1776 _elm_direction_arrows_eval(sid); 1792 _elm_direction_arrows_eval(sid, EINA_TRUE);
1777} 1793}
1778 1794
1779EOLIAN static void 1795EOLIAN static void
@@ -4012,6 +4028,21 @@ _scroll_event_object_detach(Evas_Object *obj)
4012} 4028}
4013 4029
4014EOLIAN static void 4030EOLIAN static void
4031_elm_interface_scrollable_reset_signals(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_Interface_Data *sid)
4032{
4033 sid->go_up = sid->go_down = sid->go_right = sid->go_left = EINA_FALSE;
4034
4035 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm");
4036 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,down", "elm");
4037 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm");
4038 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,left", "elm");
4039 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,vbar", "elm");
4040 edje_object_signal_emit(sid->edje_obj, "elm,action,hide,hbar", "elm");
4041
4042 _elm_scroll_scroll_bar_visibility_adjust(sid);
4043}
4044
4045EOLIAN static void
4015_elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Object *edje_object, Evas_Object *hit_rectangle) 4046_elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *sid, Evas_Object *edje_object, Evas_Object *hit_rectangle)
4016{ 4047{
4017 Evas_Coord mw, mh; 4048 Evas_Coord mw, mh;
@@ -4023,6 +4054,8 @@ _elm_interface_scrollable_objects_set(Eo *obj, Elm_Scrollable_Smart_Interface_Da
4023 4054
4024 sid->edje_obj = edje_object; 4055 sid->edje_obj = edje_object;
4025 4056
4057 elm_interface_scrollable_reset_signals(obj);
4058
4026 if (sid->event_rect) 4059 if (sid->event_rect)
4027 _scroll_event_object_detach(obj); 4060 _scroll_event_object_detach(obj);
4028 4061
@@ -4121,7 +4154,7 @@ _elm_scroll_scroll_bar_reset(Elm_Scrollable_Smart_Interface_Data *sid)
4121 } 4154 }
4122 if ((px != minx) || (py != miny)) 4155 if ((px != minx) || (py != miny))
4123 edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm"); 4156 edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
4124 _elm_direction_arrows_eval(sid); 4157 _elm_direction_arrows_eval(sid, EINA_TRUE);
4125} 4158}
4126 4159
4127static void 4160static void
@@ -4519,7 +4552,7 @@ _elm_interface_scrollable_policy_set(Eo *obj EINA_UNUSED, Elm_Scrollable_Smart_I
4519 _elm_scroll_policy_signal_emit(sid); 4552 _elm_scroll_policy_signal_emit(sid);
4520 if (sid->cb_func.content_min_limit) 4553 if (sid->cb_func.content_min_limit)
4521 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h); 4554 sid->cb_func.content_min_limit(sid->obj, sid->min_w, sid->min_h);
4522 _elm_direction_arrows_eval(sid); 4555 _elm_direction_arrows_eval(sid, EINA_TRUE);
4523} 4556}
4524 4557
4525EOLIAN static void 4558EOLIAN static void