Fixed closing of popups
This commit is contained in:
@ -19,17 +19,11 @@ void PopupDisplay::initScreen(TftInterface &tft)
|
|||||||
initOverlay(tft);
|
initOverlay(tft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupDisplay::redraw(TftInterface &tft)
|
|
||||||
{
|
|
||||||
if (m_wantsClose)
|
|
||||||
closeOverlay(tft);
|
|
||||||
else
|
|
||||||
Base::redraw(tft);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupDisplay::closeOverlay()
|
void PopupDisplay::closeOverlay()
|
||||||
{
|
{
|
||||||
m_wantsClose = true;
|
espgui::changeScreenCallback = [this](espgui::TftInterface &tft){
|
||||||
|
closeOverlay(tft);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupDisplay::closeOverlay(TftInterface &tft)
|
void PopupDisplay::closeOverlay(TftInterface &tft)
|
||||||
|
@ -17,16 +17,12 @@ public:
|
|||||||
|
|
||||||
void initScreen(TftInterface &tft) override;
|
void initScreen(TftInterface &tft) override;
|
||||||
|
|
||||||
void redraw(TftInterface &tft) override;
|
|
||||||
|
|
||||||
virtual void initOverlay(TftInterface &tft) = 0;
|
virtual void initOverlay(TftInterface &tft) = 0;
|
||||||
void closeOverlay();
|
void closeOverlay();
|
||||||
void closeOverlay(TftInterface &tft);
|
void closeOverlay(TftInterface &tft);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Display> m_lastDisplay;
|
std::unique_ptr<Display> m_lastDisplay;
|
||||||
|
|
||||||
bool m_wantsClose{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace espgui
|
} // namespace espgui
|
||||||
|
Reference in New Issue
Block a user