Fixed closing of popups
This commit is contained in:
@ -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)
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user