diff options
Diffstat (limited to 'src/displayapp/screens/settings')
-rw-r--r-- | src/displayapp/screens/settings/SettingWatchFace.cpp | 16 | ||||
-rw-r--r-- | src/displayapp/screens/settings/SettingWatchFace.h | 3 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp index 6d47f3a5..217f97b8 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.cpp +++ b/src/displayapp/screens/settings/SettingWatchFace.cpp @@ -4,15 +4,20 @@ #include "displayapp/screens/CheckboxList.h" #include "displayapp/screens/Screen.h" #include "components/settings/Settings.h" +#include "displayapp/screens/WatchFaceInfineat.h" +#include "displayapp/screens/WatchFaceCasioStyleG7710.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) +SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, + Pinetime::Controllers::Settings& settingsController, + Pinetime::Controllers::FS& filesystem) : Screen(app), settingsController {settingsController}, + filesystem {filesystem}, screens {app, 0, {[this]() -> std::unique_ptr<Screen> { @@ -33,7 +38,8 @@ bool SettingWatchFace::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr<Screen> SettingWatchFace::CreateScreen1() { - std::array<const char*, 4> watchfaces {"Digital face", "Analog face", "PineTimeStyle", "Terminal"}; + std::array<Screens::CheckboxList::Item, 4> watchfaces { + {{"Digital face", true}, {"Analog face", true}, {"PineTimeStyle", true}, {"Terminal", true}}}; return std::make_unique<Screens::CheckboxList>( 0, 2, @@ -49,7 +55,11 @@ std::unique_ptr<Screen> SettingWatchFace::CreateScreen1() { } std::unique_ptr<Screen> SettingWatchFace::CreateScreen2() { - std::array<const char*, 4> watchfaces {"Infineat face", "Casio G7710", "", ""}; + std::array<Screens::CheckboxList::Item, 4> watchfaces { + {{"Infineat face", Applications::Screens::WatchFaceInfineat::IsAvailable(filesystem)}, + {"Casio G7710", Applications::Screens::WatchFaceCasioStyleG7710::IsAvailable(filesystem)}, + {"", false}, + {"", false}}}; return std::make_unique<Screens::CheckboxList>( 1, 2, diff --git a/src/displayapp/screens/settings/SettingWatchFace.h b/src/displayapp/screens/settings/SettingWatchFace.h index 7d14554e..158397f8 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.h +++ b/src/displayapp/screens/settings/SettingWatchFace.h @@ -16,13 +16,14 @@ namespace Pinetime { class SettingWatchFace : public Screen { public: - SettingWatchFace(DisplayApp* app, Pinetime::Controllers::Settings& settingsController); + SettingWatchFace(DisplayApp* app, Pinetime::Controllers::Settings& settingsController, Pinetime::Controllers::FS& filesystem); ~SettingWatchFace() override; bool OnTouchEvent(TouchEvents event) override; private: Controllers::Settings& settingsController; + Pinetime::Controllers::FS& filesystem; ScreenList<2> screens; static constexpr const char* title = "Watch face"; |