Add modelNotes icon to the carousel if notes exist

Resolves #488
This commit is contained in:
eshifri
2021-07-31 07:50:02 +02:00
committed by Raphael Coeffic
parent 46688263ee
commit 645afc1176
@@ -30,6 +30,7 @@
#include "view_channels.h"
#include "view_statistics.h"
#include "select_fab_carousel.h"
#include "view_text.h"
ViewMainMenu::ViewMainMenu(Window* parent) :
Window(parent->getFullScreenWindow(), {})
@@ -58,6 +59,14 @@ ViewMainMenu::ViewMainMenu(Window* parent) :
return 0;
});
if (modelHasNotes()) {
carousel->addButton(ICON_MODEL, "Model\nNotes", [=]() -> uint8_t {
deleteLater();
readModelNotes();
return 0;
});
}
carousel->addButton(ICON_MONITOR, "Channel\nMonitor", [=]() -> uint8_t {
deleteLater();
new ChannelsViewMenu();