Watch face settings : disable watch faces that are not available (external resources are not installed).
This commit is contained in:
@@ -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,
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user