#include "displayapp/screens/settings/SettingWatchFace.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/CheckboxList.h" #include "displayapp/screens/Screen.h" #include "displayapp/screens/Styles.h" #include "displayapp/screens/Symbols.h" #include "components/settings/Settings.h" using namespace Pinetime::Applications::Screens; constexpr const char* SettingWatchFace::title; constexpr const char* SettingWatchFace::symbol; SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) : Screen(app), settingsController {settingsController}, screens {app, settingsController.GetWatchfacesMenu(), { [this]() -> std::unique_ptr { return CreateScreen1(); }, [this]() -> std::unique_ptr { return CreateScreen2(); } }, Screens::ScreenListModes::UpDown} { } SettingWatchFace::~SettingWatchFace() { lv_obj_clean(lv_scr_act()); settingsController.SaveSettings(); } bool SettingWatchFace::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return screens.OnTouchEvent(event); } std::unique_ptr SettingWatchFace::CreateScreen1() { std::array watchfaces {" Digital face", " Analog face", " PineTimeStyle", " Terminal"}; return std::make_unique(0, 2, app, settingsController, title, symbol, &Controllers::Settings::SetClockFace, &Controllers::Settings::GetClockFace, watchfaces); } std::unique_ptr SettingWatchFace::CreateScreen2() { std::array watchfaces {" Infineat face", "", "", ""}; return std::make_unique(1, 2, app, settingsController, title, symbol, &Controllers::Settings::SetClockFace, &Controllers::Settings::GetClockFace, watchfaces); }