Cosmetics

This commit is contained in:
Bertrand Songis
2020-04-16 16:28:33 +02:00
parent fe9f5d9a3a
commit 61f8834c42
2 changed files with 10 additions and 4 deletions
+7 -1
View File
@@ -67,7 +67,13 @@ class ExpansionPanel: public FormGroup {
void open(bool state = true)
{
isOpen = state;
coord_t newHeight = (state ? header->height() + body->height() : header->height());
updateHeight();
}
void updateHeight()
{
body->adjustInnerHeight();
coord_t newHeight = (isOpen ? header->height() + body->height() : header->height());
parent->moveWindowsTop(bottom(), newHeight - height());
setHeight(newHeight);
}
+3 -3
View File
@@ -418,11 +418,11 @@ bool Window::onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY,
void Window::adjustInnerHeight()
{
innerHeight = 0;
coord_t bottomMax = 0;
for (auto child: children) {
innerHeight = max(innerHeight, child->rect.y + child->rect.h);
bottomMax = max(bottomMax, child->rect.y + child->rect.h);
}
invalidate();
setInnerHeight(bottomMax);
}
coord_t Window::adjustHeight()