summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/FlashLight.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/FlashLight.h')
-rw-r--r--src/displayapp/screens/FlashLight.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/displayapp/screens/FlashLight.h b/src/displayapp/screens/FlashLight.h
index 3433634..f227599 100644
--- a/src/displayapp/screens/FlashLight.h
+++ b/src/displayapp/screens/FlashLight.h
@@ -13,14 +13,20 @@ namespace Pinetime {
class FlashLight : public Screen {
public:
- FlashLight(DisplayApp* app, System::SystemTask& systemTask, Controllers::BrightnessController& brightness);
+ FlashLight(DisplayApp* app, System::SystemTask& systemTask, Controllers::BrightnessController& brightness, lv_color_t color = LV_COLOR_WHITE);
~FlashLight() override;
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
private:
inline void OnClickEvent(lv_obj_t* obj, lv_event_t event) {
- if (obj == backgroundAction && event == LV_EVENT_CLICKED) {
+ if (obj == backgroundAction) {
+ if (event == LV_EVENT_CLICKED) {
+ } else if (event == LV_EVENT_LONG_PRESSED) {
+ color = (color.full == LV_COLOR_WHITE.full) ? LV_COLOR_RED : LV_COLOR_WHITE;
+ } else {
+ return;
+ }
Update(!isOn, brightnessLevel);
}
}
@@ -35,6 +41,7 @@ namespace Pinetime {
lv_obj_t* flashLight;
lv_obj_t* backgroundAction;
lv_obj_t* indicators[3];
+ lv_color_t color;
bool isOn = false;
};
}