From 41cace6e2e439db15253e36c116c225a3ba122f9 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 26 May 2020 16:10:24 +0200 Subject: [PATCH] ExpansionPanel fix --- radio/src/thirdparty/libopenui/src/expansion_panel.cpp | 7 +++++++ radio/src/thirdparty/libopenui/src/expansion_panel.h | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/expansion_panel.cpp b/radio/src/thirdparty/libopenui/src/expansion_panel.cpp index 6f2a84689..a73e098c9 100644 --- a/radio/src/thirdparty/libopenui/src/expansion_panel.cpp +++ b/radio/src/thirdparty/libopenui/src/expansion_panel.cpp @@ -19,6 +19,13 @@ #include "expansion_panel.h" +void ExpansionPanel::updateHeight() +{ + coord_t newHeight = (isOpen ? header->height() + body->height() : header->height()); + parent->moveWindowsTop(bottom(), newHeight - height()); + setHeight(newHeight); +} + ExpansionPanelHeader::ExpansionPanelHeader(ExpansionPanel * parent): FormGroup(parent, {0, 0, parent->width(), parent->height()}, FORWARD_SCROLL) { diff --git a/radio/src/thirdparty/libopenui/src/expansion_panel.h b/radio/src/thirdparty/libopenui/src/expansion_panel.h index 26ce33af4..67286faee 100644 --- a/radio/src/thirdparty/libopenui/src/expansion_panel.h +++ b/radio/src/thirdparty/libopenui/src/expansion_panel.h @@ -70,15 +70,7 @@ class ExpansionPanel: public FormGroup { updateHeight(); } - void updateHeight() - { - coord_t previousHeight = height(); - coord_t previousBottom = bottom(); - body->adjustInnerHeight(); - coord_t newHeight = (isOpen ? header->height() + body->height() : header->height()); - parent->moveWindowsTop(previousBottom, newHeight - previousHeight); - setHeight(newHeight); - } + void updateHeight(); void setFocus(uint8_t flag) override {