diff options
| author | JF <JF002@users.noreply.github.com> | 2022-09-27 21:27:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-27 21:27:36 +0200 |
| commit | 63932810d2707e6c530dae64b209ac240137dc17 (patch) | |
| tree | c6b6b10268726781ce6ee9ef8b64c99680e11ae5 /src/displayapp/screens/CheckboxList.h | |
| parent | f699261ca326c76b72a864cb9576cf4c69bd5474 (diff) | |
| parent | 58586d0ad1ebeefd7a6f269089f467ccba2f468c (diff) | |
Merge pull request #1024 from dmlls/infineat-pr
Infineat Watchface + support for external resources.
Diffstat (limited to 'src/displayapp/screens/CheckboxList.h')
| -rw-r--r-- | src/displayapp/screens/CheckboxList.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/displayapp/screens/CheckboxList.h b/src/displayapp/screens/CheckboxList.h new file mode 100644 index 00000000..5bdd143e --- /dev/null +++ b/src/displayapp/screens/CheckboxList.h @@ -0,0 +1,48 @@ +#pragma once + +#include <lvgl/lvgl.h> +#include <cstdint> +#include <memory> +#include <array> +#include "displayapp/screens/Screen.h" +#include "displayapp/Apps.h" +#include "components/settings/Settings.h" + +namespace Pinetime { + namespace Applications { + namespace Screens { + class CheckboxList : public Screen { + public: + static constexpr size_t MaxItems = 4; + + CheckboxList(const uint8_t screenID, + const uint8_t numScreens, + DisplayApp* app, + Controllers::Settings& settingsController, + const char* optionsTitle, + const char* optionsSymbol, + void (Controllers::Settings::*SetOptionIndex)(uint8_t), + uint8_t (Controllers::Settings::*GetOptionIndex)() const, + std::array<const char*, MaxItems> options); + + ~CheckboxList() override; + + void UpdateSelected(lv_obj_t* object, lv_event_t event); + + private: + const uint8_t screenID; + Controllers::Settings& settingsController; + const char* optionsTitle; + const char* optionsSymbol; + void (Controllers::Settings::*SetOptionIndex)(uint8_t); + uint8_t (Controllers::Settings::*GetOptionIndex)() const; + std::array<const char*, MaxItems> options; + std::array<lv_obj_t*, MaxItems> cbOption; + std::array<lv_point_t, 2> pageIndicatorBasePoints; + std::array<lv_point_t, 2> pageIndicatorPoints; + lv_obj_t* pageIndicatorBase; + lv_obj_t* pageIndicator; + }; + } + } +} |
