[ExpansionPanel] Fixes

This commit is contained in:
Bertrand Songis
2021-01-07 20:14:02 +01:00
parent 5742a67cb9
commit be9595c161
3 changed files with 10 additions and 4 deletions
+4 -2
View File
@@ -19,10 +19,12 @@
#include "expansion_panel.h"
void ExpansionPanel::updateHeight()
void ExpansionPanel::updateHeight(bool move)
{
coord_t newHeight = (isOpen ? header->height() + body->height() : header->height());
parent->moveWindowsTop(bottom(), newHeight - height());
if (move) {
parent->moveWindowsTop(bottom(), newHeight - height());
}
setHeight(newHeight);
}
+2 -2
View File
@@ -64,7 +64,7 @@ class ExpansionPanel: public FormGroup
open(!isOpen);
}
void open(bool state = true)
virtual void open(bool state = true)
{
isOpen = state;
updateHeight();
@@ -82,7 +82,7 @@ class ExpansionPanel: public FormGroup
enable(false);
}
void updateHeight();
void updateHeight(bool move = true);
void setFocus(uint8_t flag) override;
+4
View File
@@ -461,6 +461,10 @@ coord_t Window::adjustHeight()
void Window::moveWindowsTop(coord_t y, coord_t delta)
{
if (getWindowFlags() & FORWARD_SCROLL) {
parent->moveWindowsTop(bottom(), delta);
}
for (auto child: children) {
if (child->rect.y >= y) {
child->rect.y += delta;