summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/FlashLight.h
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-21 08:58:35 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-21 09:49:45 (GMT)
commit513b2f2cbd83eb20602f0d6f0158a0969f981b0a (patch)
treec15d2a3126a3c282ff073c7a187af31915001a08 /src/displayapp/screens/FlashLight.h
parent4dd1f78c8697a11c2fbb666dcf07cf0f6c33d114 (diff)
Flashlight app: inline functions that are only used once.
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;