[ExpansionPanel] Fixes
This commit is contained in:
+4
-2
@@ -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
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user