summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2014-07-07 15:08:45 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2014-07-07 15:08:45 +0900
commit25c01e026220f533080ceb459a567b772eb1cbcd (patch)
treed9d787285fb39437d923c100a5c879e63dbaefe6 /src/bin
parent2c142e6271025bc2a6b8cee953e29e094adf2507 (diff)
panel: add scrollable feature
This implements scrollable interface in elm_panel so that users can drag open/close panel. Tap & hold on the edge and panel handler will appear. Left scrollable panel is implemented in elementary_test > Panel Scrollable. @feature
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test.c2
-rw-r--r--src/bin/test_panel.c73
2 files changed, 75 insertions, 0 deletions
diff --git a/src/bin/test.c b/src/bin/test.c
index ada5c2516..ae3976c19 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -158,6 +158,7 @@ void test_slideshow(void *data, Evas_Object *obj, void *event_info);
158void test_menu(void *data, Evas_Object *obj, void *event_info); 158void test_menu(void *data, Evas_Object *obj, void *event_info);
159void test_menu2(void *data, Evas_Object *obj, void *event_info); 159void test_menu2(void *data, Evas_Object *obj, void *event_info);
160void test_panel(void *data, Evas_Object *obj, void *event_info); 160void test_panel(void *data, Evas_Object *obj, void *event_info);
161void test_panel2(void *data, Evas_Object *obj, void *event_info);
161void test_panes(void *data, Evas_Object *obj, void *event_info); 162void test_panes(void *data, Evas_Object *obj, void *event_info);
162void test_calendar(void *data, Evas_Object *obj, void *event_info); 163void test_calendar(void *data, Evas_Object *obj, void *event_info);
163void test_calendar2(void *data, Evas_Object *obj, void *event_info); 164void test_calendar2(void *data, Evas_Object *obj, void *event_info);
@@ -785,6 +786,7 @@ add_tests:
785 786
786 //------------------------------// 787 //------------------------------//
787 ADD_TEST(NULL, "Dividers", "Panel", test_panel); 788 ADD_TEST(NULL, "Dividers", "Panel", test_panel);
789 ADD_TEST(NULL, "Dividers", "Panel Scrollable", test_panel2);
788 ADD_TEST(NULL, "Dividers", "Panes", test_panes); 790 ADD_TEST(NULL, "Dividers", "Panes", test_panes);
789 791
790 //------------------------------// 792 //------------------------------//
diff --git a/src/bin/test_panel.c b/src/bin/test_panel.c
index d0b7f6b3f..7743174ce 100644
--- a/src/bin/test_panel.c
+++ b/src/bin/test_panel.c
@@ -270,3 +270,76 @@ test_panel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
270 evas_object_resize(win, 320, 400); 270 evas_object_resize(win, 320, 400);
271 evas_object_show(win); 271 evas_object_show(win);
272} 272}
273
274static void
275_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
276{
277 Evas_Object *panel = data;
278 elm_panel_toggle(panel);
279}
280
281void
282test_panel2(void *data EINA_UNUSED,
283 Evas_Object *obj EINA_UNUSED,
284 void *event_info EINA_UNUSED)
285{
286 Evas_Object *win, *box, *table, *panel, *list, *button;
287 int i;
288
289 // Left Panel
290 win = elm_win_util_standard_add("panel", "Left Panel");
291 elm_win_autodel_set(win, EINA_TRUE);
292 evas_object_resize(win, 320, 400);
293 evas_object_show(win);
294
295 // box for button and table
296 box = elm_box_add(win);
297 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
298 evas_object_show(box);
299 elm_win_resize_object_add(win, box);
300
301 // toggle button
302 button = elm_button_add(box);
303 evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
304 evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
305 evas_object_show(button);
306 elm_object_text_set(button, "Toggle");
307 elm_box_pack_end(box, button);
308
309 // table for panel and center content
310 table = elm_table_add(win);
311 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
312 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
313 evas_object_show(table);
314 elm_box_pack_end(box, table);
315
316 // center content
317 list = elm_list_add(table);
318 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
319 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
320 evas_object_show(list);
321 for (i = 0; i < 20; i++)
322 elm_list_item_append(list, "center list item", NULL, NULL, NULL, NULL);
323 elm_table_pack(table, list, 0, 0, 1, 1);
324
325 // panel
326 panel = elm_panel_add(table);
327 evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
328 evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL);
329 evas_object_show(panel);
330 elm_table_pack(table, panel, 0, 0, 1, 1);
331
332 elm_panel_scrollable_set(panel, EINA_TRUE);
333 elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT);
334 elm_panel_hidden_set(panel, EINA_TRUE);
335 elm_panel_scrollable_content_size_set(panel, 0.75);
336
337 list = elm_list_add(panel);
338 evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
339 evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
340 for (i = 0; i < 7; i++)
341 elm_list_item_append(list, "panel list item", NULL, NULL, NULL, NULL);
342 elm_object_content_set(panel, list);
343
344 evas_object_smart_callback_add(button, "clicked", _clicked_cb, panel);
345}