forked from enlightenment/efl
Add 2 buttons in the Scroller test to reveal one more bug
the buttons should scroll up and down by 1 px, but nothing move here That test was still broken in other ways, for example: play a bit with the "to X Y" buttons and see if it always do the correct thing
This commit is contained in:
parent
7cce17fd46
commit
3ef3500330
|
@ -27,6 +27,24 @@ _my_bt_go_900_900(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EIN
|
|||
elm_scroller_region_bring_in((Evas_Object *)data, 900, 900, 318, 318);
|
||||
}
|
||||
|
||||
static void
|
||||
_my_bt_y_minus_one(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
int x, y, w, h;
|
||||
elm_scroller_region_get((Evas_Object *)data, &x, &y, &w, &h);
|
||||
printf("Current region: %d %d %d %d\n", x, y, w, h);
|
||||
elm_scroller_region_show((Evas_Object *)data, x, y - 1, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_my_bt_y_plus_one(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
int x, y, w, h;
|
||||
elm_scroller_region_get((Evas_Object *)data, &x, &y, &w, &h);
|
||||
printf("Current region: %d %d %d %d\n", x, y, w, h);
|
||||
elm_scroller_region_show((Evas_Object *)data, x, y + 1, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_my_bt_prev_page(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -344,6 +362,14 @@ test_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
|
|||
elm_table_pack(tb2, bt, 0, 0, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
bt = elm_button_add(win);
|
||||
elm_object_text_set(bt, "y -1 px");
|
||||
evas_object_smart_callback_add(bt, "clicked", _my_bt_y_minus_one, sc);
|
||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(bt, 0.5, 0.1);
|
||||
elm_table_pack(tb2, bt, 1, 0, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
bt = elm_button_add(win);
|
||||
elm_object_text_set(bt, "to 900 300");
|
||||
evas_object_smart_callback_add(bt, "clicked", _my_bt_go_900_300, sc);
|
||||
|
@ -360,6 +386,14 @@ test_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
|
|||
elm_table_pack(tb2, bt, 0, 2, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
bt = elm_button_add(win);
|
||||
elm_object_text_set(bt, "y +1 px");
|
||||
evas_object_smart_callback_add(bt, "clicked", _my_bt_y_plus_one, sc);
|
||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(bt, 0.5, 0.9);
|
||||
elm_table_pack(tb2, bt, 1, 2, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
bt = elm_button_add(win);
|
||||
elm_object_text_set(bt, "to 900 900");
|
||||
evas_object_smart_callback_add(bt, "clicked", _my_bt_go_900_900, sc);
|
||||
|
|
Loading…
Reference in New Issue