Fixed closing of popups

This commit is contained in:
2023-01-23 20:31:06 +01:00
parent ec7ddb8dea
commit 7cfa4b85e1
2 changed files with 3 additions and 13 deletions

View File

@ -19,17 +19,11 @@ void PopupDisplay::initScreen(TftInterface &tft)
initOverlay(tft);
}
void PopupDisplay::redraw(TftInterface &tft)
{
if (m_wantsClose)
closeOverlay(tft);
else
Base::redraw(tft);
}
void PopupDisplay::closeOverlay()
{
m_wantsClose = true;
espgui::changeScreenCallback = [this](espgui::TftInterface &tft){
closeOverlay(tft);
};
}
void PopupDisplay::closeOverlay(TftInterface &tft)

View File

@ -17,16 +17,12 @@ public:
void initScreen(TftInterface &tft) override;
void redraw(TftInterface &tft) override;
virtual void initOverlay(TftInterface &tft) = 0;
void closeOverlay();
void closeOverlay(TftInterface &tft);
private:
std::unique_ptr<Display> m_lastDisplay;
bool m_wantsClose{};
};
} // namespace espgui