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