Fixed scrolling

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent 2baf771c30
commit 7f724c187d
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -90,7 +90,7 @@ class MenuToolbar: public FormGroup {
scrollTo(button);
}
else {
setScrollPositionY(0);
lv_obj_scroll_to_y(lvobj, 0, LV_ANIM_OFF);
}
}
}