Skip to content

Commit

Permalink
fix(color): Prevent multiple instances of the main menu popup (#3067)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Jan 24, 2023
1 parent 2d534a8 commit 80f3cbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
5 changes: 5 additions & 0 deletions radio/src/gui/colorlcd/view_main_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ void ViewMainMenu::deleteLater(bool detach, bool trash)
Window::deleteLater(detach, trash);
}

void ViewMainMenu::onClicked()
{
deleteLater();
}

void ViewMainMenu::onCancel()
{
deleteLater();
Expand Down
16 changes: 1 addition & 15 deletions radio/src/gui/colorlcd/view_main_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,10 @@ class ViewMainMenu : public Window
ViewMainMenu(Window* parent);

void onCancel() override;
void onClicked() override;
void paint(BitmapBuffer* dc) override;
void deleteLater(bool detach = true, bool trash = true) override;

#if defined(HARDWARE_TOUCH)
bool onTouchStart(coord_t /*x*/, coord_t /*y*/) override { return true; }
bool onTouchEnd(coord_t x, coord_t y) override
{
deleteLater();
return true;
}
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY,
coord_t slideX, coord_t slideY) override
{
Window::onTouchSlide(x, y, startX, startY, slideX, slideY);
return true;
}
#endif

protected:
rect_t carouselRect;
};

0 comments on commit 80f3cbe

Please sign in to comment.