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.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/displayapp/screens/FlashLight.h b/src/displayapp/screens/FlashLight.h
index 76dda78..3433634 100644
--- a/src/displayapp/screens/FlashLight.h
+++ b/src/displayapp/screens/FlashLight.h
@@ -17,10 +17,15 @@ namespace Pinetime {
~FlashLight() override;
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
- void OnClickEvent(lv_obj_t* obj, lv_event_t event);
private:
+ inline void OnClickEvent(lv_obj_t* obj, lv_event_t event) {
+ if (obj == backgroundAction && event == LV_EVENT_CLICKED) {
+ Update(!isOn, brightnessLevel);
+ }
+ }
void Update(bool on, Pinetime::Controllers::BrightnessController::Levels level);
+ static void EventHandler(lv_obj_t* obj, lv_event_t event);
Pinetime::System::SystemTask& systemTask;
Controllers::BrightnessController& brightnessController;