fix(color): window tree preventing superfluous drawing (#2509)
This prevents the main view to be redrawn if fully covered by a tab group, a page or a full screen dialog.
This commit is contained in:
@@ -116,47 +116,6 @@ const uint8_t _LBM_SHUTDOWN_CIRCLE[] = {
|
|||||||
};
|
};
|
||||||
STATIC_LZ4_BITMAP(LBM_SHUTDOWN_CIRCLE);
|
STATIC_LZ4_BITMAP(LBM_SHUTDOWN_CIRCLE);
|
||||||
|
|
||||||
class ShutdownAnimation: public FormGroup
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ShutdownAnimation(uint32_t duration, uint32_t totalDuration):
|
|
||||||
FormGroup(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE | FORM_NO_BORDER),
|
|
||||||
duration(duration),
|
|
||||||
totalDuration(totalDuration)
|
|
||||||
{
|
|
||||||
Layer::push(this);
|
|
||||||
bringToTop();
|
|
||||||
// setFocus(SET_FOCUS_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(DEBUG_WINDOWS)
|
|
||||||
std::string getName() const override
|
|
||||||
{
|
|
||||||
return "ShutdownAnimation";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
void paint(BitmapBuffer * dc) override
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void deleteLater(bool detach = true, bool trash = true) override
|
|
||||||
{
|
|
||||||
Layer::pop(this);
|
|
||||||
Window::deleteLater(detach, trash);
|
|
||||||
}
|
|
||||||
|
|
||||||
void update(uint32_t newDuration, uint32_t newTotalDuration)
|
|
||||||
{
|
|
||||||
duration = newDuration;
|
|
||||||
totalDuration = newTotalDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
uint32_t duration;
|
|
||||||
uint32_t totalDuration;
|
|
||||||
std::string message;
|
|
||||||
};
|
|
||||||
|
|
||||||
void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration,
|
void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration,
|
||||||
const char* message)
|
const char* message)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
FullScreenDialog::FullScreenDialog(
|
FullScreenDialog::FullScreenDialog(
|
||||||
uint8_t type, std::string title, std::string message, std::string action,
|
uint8_t type, std::string title, std::string message, std::string action,
|
||||||
const std::function<void(void)>& confirmHandler) :
|
const std::function<void(void)>& confirmHandler) :
|
||||||
Window(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
Window(Layer::back(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||||
type(type),
|
type(type),
|
||||||
title(std::move(title)),
|
title(std::move(title)),
|
||||||
message(std::move(message)),
|
message(std::move(message)),
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ static constexpr rect_t _get_body_rect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Page::Page(unsigned icon):
|
Page::Page(unsigned icon):
|
||||||
Window(MainWindow::instance(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
Window(Layer::back(), {0, 0, LCD_W, LCD_H}, OPAQUE),
|
||||||
header(this, icon),
|
header(this, icon),
|
||||||
body(this, _get_body_rect(), FORM_FORWARD_FOCUS)
|
body(this, _get_body_rect(), FORM_FORWARD_FOCUS)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ static constexpr rect_t _get_body_rect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
TabsGroup::TabsGroup(uint8_t icon):
|
TabsGroup::TabsGroup(uint8_t icon):
|
||||||
Window(MainWindow::instance(), { 0, 0, LCD_W, LCD_H }, OPAQUE),
|
Window(Layer::back(), { 0, 0, LCD_W, LCD_H }, OPAQUE),
|
||||||
header(this, icon),
|
header(this, icon),
|
||||||
body(this, _get_body_rect(), NO_FOCUS | FORM_FORWARD_FOCUS)
|
body(this, _get_body_rect(), NO_FOCUS | FORM_FORWARD_FOCUS)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user