TODO implemented

This commit is contained in:
Bertrand Songis
2020-04-16 16:12:16 +02:00
parent 98cf1f6c92
commit fe9f5d9a3a
3 changed files with 16 additions and 6 deletions
+2 -4
View File
@@ -117,8 +117,7 @@ void FormGroup::setFocus(uint8_t flag)
break;
case SET_FOCUS_BACKWARD:
// TODO this test should be recursive
if (focusWindow == first || focusWindow->getParent() == first) {
if (focusWindow->isChild(first)) {
if (previous == this)
last->setFocus(SET_FOCUS_BACKWARD);
else if (previous)
@@ -131,8 +130,7 @@ void FormGroup::setFocus(uint8_t flag)
break;
case SET_FOCUS_FORWARD:
// TODO this test should be recursive
if (focusWindow == last || focusWindow->getParent() == last || focusWindow->getParent()->getParent() == last) {
if (focusWindow->isChild(last)) {
if (next == this)
first->setFocus(SET_FOCUS_FORWARD);
else if (next)
+1
View File
@@ -422,6 +422,7 @@ void Window::adjustInnerHeight()
for (auto child: children) {
innerHeight = max(innerHeight, child->rect.y + child->rect.h);
}
invalidate();
}
coord_t Window::adjustHeight()
+13 -2
View File
@@ -99,6 +99,11 @@ class Window {
return parent;
}
bool isChild(Window * window) const
{
return window == this || (getParent() && getParent()->isChild(window));
}
Window * getFullScreenWindow()
{
return (width() == LCD_W && height() == LCD_H) ? this : parent->getFullScreenWindow();
@@ -174,7 +179,9 @@ class Window {
void setHeight(coord_t value)
{
rect.h = value;
if (innerHeight <= value) {
if (windowFlags & FORWARD_SCROLL)
innerHeight = value;
else if (innerHeight <= value) {
setScrollPositionY(0);
}
invalidate();
@@ -268,7 +275,11 @@ class Window {
void setInnerHeight(coord_t h)
{
innerHeight = h;
if (height() >= h) {
if (windowFlags & FORWARD_SCROLL) {
rect.h = innerHeight;
parent->adjustInnerHeight();
}
else if (height() >= h) {
setScrollPositionY(0);
}
else {