}
static void
+_my_bt_prev_page(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *sc = (Evas_Object *)data;
+ int page_x = 0, page_y = 0;
+ elm_scroller_current_page_get(sc, &page_x, &page_y);
+ elm_scroller_page_bring_in(sc, --page_x, page_y);
+}
+
+static void
+_my_bt_next_page(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *sc = (Evas_Object *)data;
+ int page_x = 0, page_y = 0;
+ elm_scroller_current_page_get(sc, &page_x, &page_y);
+ elm_scroller_page_bring_in(sc, ++page_x, page_y);
+}
+
+static void
_my_bt_freeze_toggle(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
if (elm_check_state_get(obj))
elm_table_pack(tb2, bt, 2, 2, 1, 1);
evas_object_show(bt);
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "prev page");
+ evas_object_smart_callback_add(bt, "clicked", _my_bt_prev_page, sc);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, 0.1, 0.5);
+ elm_table_pack(tb2, bt, 0, 1, 1, 1);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "next page");
+ evas_object_smart_callback_add(bt, "clicked", _my_bt_next_page, sc);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, 0.9, 0.5);
+ elm_table_pack(tb2, bt, 2, 1, 1, 1);
+ evas_object_show(bt);
+
evas_object_event_callback_add(sc, EVAS_CALLBACK_MOVE, _sc_move_cb, tb2);
evas_object_event_callback_add(sc, EVAS_CALLBACK_RESIZE, _sc_resize_cb, tb2);
evas_object_geometry_get(sc, &x, &y, &w, &h);
if (sid->pagesize_h > 0)
{
- x = x + (sid->pagesize_h * 0.5);
+ if (x >= 0)
+ x = x + (sid->pagesize_h * 0.5);
+ else if (x < 0 && sid->loop_h)
+ x = x - (sid->pagesize_h * 0.5);
x = x / (sid->pagesize_h);
x = x * (sid->pagesize_h);
}
if (sid->pagesize_v > 0)
{
- y = y + (sid->pagesize_v * 0.5);
+ if (y >= 0)
+ y = y + (sid->pagesize_v * 0.5);
+ else if (y < 0 && sid->loop_v)
+ y = y - (sid->pagesize_v * 0.5);
y = y / (sid->pagesize_v);
y = y * (sid->pagesize_v);
}
eo_do(sid->obj, elm_interface_scrollable_content_viewport_geometry_get
(NULL, NULL, &w, &h));
- if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
- if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
+ x = sid->pagesize_h * pagenumber_h;
+ y = sid->pagesize_v * pagenumber_v;
sid->wx = (sid->is_mirrored ? _elm_scroll_x_mirrored_get(sid->obj, x) : x);
sid->wy = y;
eo_do(sid->obj, elm_interface_scrollable_content_viewport_geometry_get
(NULL, NULL, &w, &h));
- if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
- if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
+ x = sid->pagesize_h * pagenumber_h;
+ y = sid->pagesize_v * pagenumber_v;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
_elm_scroll_scroll_to_x(sid, _elm_config->bring_in_scroll_friction, x);