Fixed scrolling
This commit is contained in:
committed by
Raphael Coeffic
parent
2baf771c30
commit
7f724c187d
+2
-2
@@ -99,12 +99,12 @@ void Keyboard::setField(FormField* newField)
|
||||
#endif
|
||||
// scroll the header of the window out of view to get more space to
|
||||
// see the field being edited
|
||||
fieldContainer->setScrollPositionY(fields->top());
|
||||
lv_obj_scroll_to_y(fieldContainer->getLvObj(), fields->top(), LV_ANIM_OFF);
|
||||
oldHeight = fields->height();
|
||||
fields->setHeight(newHeight);
|
||||
|
||||
coord_t offsetY = calcScrollOffsetForField(newField, fields);
|
||||
fields->setScrollPositionY(offsetY);
|
||||
lv_obj_scroll_to_y(fields->getLvObj(), offsetY, LV_ANIM_OFF);
|
||||
} else {
|
||||
// TODO: what happens if field container is null.
|
||||
// we will need to interrogate the fieldContainer for its
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ void MenuBody::setIndex(int index)
|
||||
scrollY += lines[i].lineHeight();
|
||||
|
||||
if (innerHeight > height()) {
|
||||
setScrollPositionY(scrollY - 3 * MENUS_LINE_HEIGHT);
|
||||
lv_obj_scroll_to_y(lvobj, scrollY - 3 * MENUS_LINE_HEIGHT, LV_ANIM_OFF);
|
||||
}
|
||||
|
||||
invalidate();
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ class MenuToolbar: public FormGroup {
|
||||
scrollTo(button);
|
||||
}
|
||||
else {
|
||||
setScrollPositionY(0);
|
||||
lv_obj_scroll_to_y(lvobj, 0, LV_ANIM_OFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user