OMOTE/Platformio/OmoteUI/UIs/BasicRefactored/page/SettingsPage.cpp
Matthew Colvin 7d68cce6ad Add start stop event handling in UIElement
Add demo page to get play logic out of settings page.

Add a demo page and a Settings page to the home screen.
2023-10-12 15:25:42 -05:00

27 lines
805 B
C++

#include "SettingsPage.hpp"
#include "BackgroundScreen.hpp"
#include "Button.hpp"
#include "Slider.hpp"
#include "List.hpp"
#include "Colors.hpp"
#include "DisplaySettings.hpp"
#include "PopUpScreen.hpp"
#include "ScreenManager.hpp"
using namespace UI::Page;
using namespace UI::Color;
SettingsPage::SettingsPage(std::shared_ptr<HardwareAbstract> aHardware)
: Base(ID::Pages::Settings),
mSettingsList(AddElement<Widget::List>(std::make_unique<Widget::List>())),
mHardware(aHardware) {
mSettingsList->AddItem("Display",LV_SYMBOL_EYE_OPEN,[this] { PushDisplaySettings(); });
mSettingsList->AddItem("Wifi",LV_SYMBOL_WIFI,[]{});
}
void SettingsPage::PushDisplaySettings() {
UI::Screen::Manager::getInstance().pushPopUp(
std::make_unique<DisplaySettings>(mHardware->display()));
}