summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-21 01:37:20 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-21 01:37:20 +0000
commit5f4524295a623117c58955c839c34462197b1197 (patch)
tree8b214661ca3e9ecb06c28b5743eb35351bf4b369 /src
parent796e345da1fd8e27c6ada3dd81cacb5f9b4f4aa9 (diff)
efl ui scroller - support signals for up/down/elft/right show/hide
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_scroll_util.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c
index 6a7378e3b4..47d50165cd 100644
--- a/src/lib/elementary/efl_ui_scroll_util.c
+++ b/src/lib/elementary/efl_ui_scroll_util.c
@@ -14,9 +14,72 @@ typedef struct {
14 int freeze_want; 14 int freeze_want;
15 Eina_Bool scroll_count : 1; 15 Eina_Bool scroll_count : 1;
16 Eina_Bool need_scroll : 1; 16 Eina_Bool need_scroll : 1;
17 Eina_Bool show_up : 1;
18 Eina_Bool show_down : 1;
19 Eina_Bool show_left: 1;
20 Eina_Bool show_right : 1;
17} Scroll_Connector_Context; 21} Scroll_Connector_Context;
18 22
19static void 23static void
24_scroll_connector_bar_direction_show_update(Scroll_Connector_Context *ctx)
25{
26 ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd);
27 Eina_Bool hbar_visible = EINA_FALSE, vbar_visible = EINA_FALSE;
28 Eina_Bool show_up = EINA_FALSE, show_down = EINA_FALSE, show_left = EINA_FALSE, show_right = EINA_FALSE;
29 double vx = 0.0, vy = 0.0;
30
31 edje_object_part_drag_value_get
32 (wd->resize_obj, "efl.draggable.vertical_bar", NULL, &vy);
33
34 edje_object_part_drag_value_get
35 (wd->resize_obj, "efl.draggable.horizontal_bar", &vx, NULL);
36
37 efl_ui_scrollbar_bar_visibility_get(ctx->smanager, &hbar_visible, &vbar_visible);
38 if (hbar_visible)
39 {
40 if (vx < 1.0) show_right = EINA_TRUE;
41 if (vx > 0.0) show_left = EINA_TRUE;
42 }
43 if (vbar_visible)
44 {
45 if (vy < 1.0) show_down = EINA_TRUE;
46 if (vy > 0.0) show_up = EINA_TRUE;
47 }
48 if (show_right != ctx->show_right)
49 {
50 if (show_right)
51 efl_layout_signal_emit(wd->resize_obj, "efl,action,show,right", "efl");
52 else
53 efl_layout_signal_emit(wd->resize_obj, "efl,action,hide,right", "efl");
54 ctx->show_right = show_right;
55 }
56 if (show_left != ctx->show_left)
57 {
58 if (show_left)
59 efl_layout_signal_emit(wd->resize_obj, "efl,action,show,left", "efl");
60 else
61 efl_layout_signal_emit(wd->resize_obj, "efl,action,hide,left", "efl");
62 ctx->show_left = show_left;
63 }
64 if (show_up != ctx->show_up)
65 {
66 if (show_up)
67 efl_layout_signal_emit(wd->resize_obj, "efl,action,show,up", "efl");
68 else
69 efl_layout_signal_emit(wd->resize_obj, "efl,action,hide,up", "efl");
70 ctx->show_up = show_up;
71 }
72 if (show_down != ctx->show_down)
73 {
74 if (show_down)
75 efl_layout_signal_emit(wd->resize_obj, "efl,action,show,down", "efl");
76 else
77 efl_layout_signal_emit(wd->resize_obj, "efl,action,hide,down", "efl");
78 ctx->show_down = show_down;
79 }
80}
81
82static void
20_scroll_connector_bar_read_and_update(Scroll_Connector_Context *ctx) 83_scroll_connector_bar_read_and_update(Scroll_Connector_Context *ctx)
21{ 84{
22 ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd); 85 ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd);
@@ -29,6 +92,7 @@ _scroll_connector_bar_read_and_update(Scroll_Connector_Context *ctx)
29 (wd->resize_obj, "efl.draggable.horizontal_bar", &vx, NULL); 92 (wd->resize_obj, "efl.draggable.horizontal_bar", &vx, NULL);
30 93
31 efl_ui_scrollbar_bar_position_set(ctx->smanager, vx, vy); 94 efl_ui_scrollbar_bar_position_set(ctx->smanager, vx, vy);
95 _scroll_connector_bar_direction_show_update(ctx);
32} 96}
33 97
34static void 98static void
@@ -54,6 +118,7 @@ _scroll_connector_reload_cb(void *data,
54 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl"); 118 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl");
55 119
56 efl_ui_scrollbar_bar_visibility_update(ctx->smanager); 120 efl_ui_scrollbar_bar_visibility_update(ctx->smanager);
121 _scroll_connector_bar_direction_show_update(ctx);
57} 122}
58 123
59 124
@@ -244,6 +309,7 @@ _scroll_connector_bar_show_cb(void *data, const Efl_Event *event)
244 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,on", "efl"); 309 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,on", "efl");
245 else if (type == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) 310 else if (type == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
246 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,on", "efl"); 311 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,on", "efl");
312 _scroll_connector_bar_direction_show_update(ctx);
247} 313}
248 314
249static void 315static void
@@ -257,6 +323,7 @@ _scroll_connector_bar_hide_cb(void *data, const Efl_Event *event)
257 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,off", "efl"); 323 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,off", "efl");
258 else if (type == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) 324 else if (type == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
259 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl"); 325 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl");
326 _scroll_connector_bar_direction_show_update(ctx);
260} 327}
261 328
262void 329void