summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-17 10:41:50 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-17 15:22:13 +0900
commit326b1e440a62ec9466c7c884944891caedaf5245 (patch)
tree977cfab12f59637f6a126d942208c13bc8a44c0b
parent561764b97213698297646dc61753381388219aaa (diff)
Revert "Revert "test/efl_ui_pager: fix demo""
This reverts commit f652bf932837846c5911c26992196213780394df. To restore d3bb1a7342b2725c585d90557926e0c433058e50 which implements features during feature freeze period, the revert commit is reverted.
-rw-r--r--src/bin/elementary/test_ui_pager.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c
index 78fb1b598e..32bc1d775a 100644
--- a/src/bin/elementary/test_ui_pager.c
+++ b/src/bin/elementary/test_ui_pager.c
@@ -36,7 +36,8 @@ typedef enum _Pack_Type {
36 PACK_BEFORE, 36 PACK_BEFORE,
37 PACK_AFTER, 37 PACK_AFTER,
38 PACK_AT, 38 PACK_AT,
39 UNPACK_AT 39 UNPACK_AT,
40 CLEAR
40} Pack_Type; 41} Pack_Type;
41 42
42typedef struct _Params { 43typedef struct _Params {
@@ -218,7 +219,7 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
218 Eo *page = NULL, *curr_page; 219 Eo *page = NULL, *curr_page;
219 int index, cnt; 220 int index, cnt;
220 221
221 if (param->type != UNPACK_AT) { 222 if ((param->type != UNPACK_AT) && (param->type != CLEAR)) {
222 index = efl_content_count(pager); 223 index = efl_content_count(pager);
223 224
224 switch (index % 3) { 225 switch (index % 3) {
@@ -260,10 +261,12 @@ static void pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
260 break; 261 break;
261 case UNPACK_AT: 262 case UNPACK_AT:
262 index = efl_ui_range_value_get(param->unpack_sp); 263 index = efl_ui_range_value_get(param->unpack_sp);
263 page = efl_pack_content_get(pager, index); 264 page = efl_pack_unpack_at(pager, index);
264 efl_pack_unpack(pager, page);
265 efl_del(page); 265 efl_del(page);
266 break; 266 break;
267 case CLEAR:
268 efl_pack_clear(pager);
269 break;
267 } 270 }
268 271
269 cnt = efl_content_count(pager); 272 cnt = efl_content_count(pager);
@@ -587,6 +590,25 @@ static void pack_cb(void *data,
587 efl_pack_end(box, in_box2); 590 efl_pack_end(box, in_box2);
588 efl_pack_end(in_box2, btn); 591 efl_pack_end(in_box2, btn);
589 efl_pack_end(in_box2, sp2); 592 efl_pack_end(in_box2, sp2);
593
594 // Clear
595 pack_param = calloc(1, sizeof(Pack_Params));
596 if (!pack_param) return;
597
598 pack_param->pager = pager;
599 pack_param->pack_sp = sp1;
600 pack_param->unpack_sp = sp2;
601 pack_param->unpack_btn = btn;
602 pack_param->type = CLEAR;
603
604 efl_add(EFL_UI_BUTTON_CLASS, box,
605 efl_text_set(efl_added, "Clear"),
606 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
607 pack_btn_cb, pack_param),
608 efl_event_callback_add(efl_added, EFL_EVENT_DEL,
609 pack_btn_del_cb, pack_param),
610 efl_pack_end(box, efl_added));
611
590} 612}
591 613
592static void current_page_cb(void *data, 614static void current_page_cb(void *data,