forked from enlightenment/efl
elm_panel: make "panel scrollable" work in elementary_test
Summary: Thumbscroll is disabled in default configuration, but "scrollable" feature in panel only works when thumbscroll is turned on. To make "scrollable" work always in elementary test, this patch enables thumbscroll temporarily regardless of configuration. (configuration is restored when sample window is closed.) Reviewers: Hermet, seoz Subscribers: seoz, Hermet Differential Revision: https://phab.enlightenment.org/D1983
This commit is contained in:
parent
7cc6360aee
commit
6d7b668dfe
|
@ -278,12 +278,18 @@ _clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
|
|||
elm_panel_toggle(panel);
|
||||
}
|
||||
|
||||
static void
|
||||
_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
elm_config_scroll_thumbscroll_enabled_set(elm_check_state_get(obj));
|
||||
}
|
||||
|
||||
void
|
||||
test_panel2(void *data EINA_UNUSED,
|
||||
Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *win, *box, *table, *panel, *list, *button;
|
||||
Evas_Object *win, *box, *label, *check, *table, *panel, *list, *button;
|
||||
int i;
|
||||
|
||||
// Left Panel
|
||||
|
@ -298,6 +304,22 @@ test_panel2(void *data EINA_UNUSED,
|
|||
evas_object_show(box);
|
||||
elm_win_resize_object_add(win, box);
|
||||
|
||||
// label
|
||||
label = elm_label_add(box);
|
||||
elm_object_text_set(label, "You should enable thumb scroll to use scrollable panel.<br/>"
|
||||
"Check below or enable thumb scroll in elementary_config.");
|
||||
evas_object_show(label);
|
||||
elm_box_pack_end(box, label);
|
||||
|
||||
// check
|
||||
check = elm_check_add(box);
|
||||
elm_check_state_set(check, elm_config_scroll_thumbscroll_enabled_get());
|
||||
elm_object_text_set(check, "Enable thumb scroll (temporarily)");
|
||||
evas_object_show(check);
|
||||
elm_box_pack_end(box, check);
|
||||
|
||||
evas_object_smart_callback_add(check, "changed", _changed_cb, NULL);
|
||||
|
||||
// toggle button
|
||||
button = elm_button_add(box);
|
||||
evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, 0);
|
||||
|
|
Loading…
Reference in New Issue