diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-10 08:31:53 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-10 08:42:51 (GMT) |
| commit | b2be5344958d38fb362bab3691fc104f0f049853 (patch) | |
| tree | 66c50ca682cc43e379981c2676ba9486539d47d0 | |
| parent | c5650a55562272aa6f4e0bdb1b78a814128b306d (diff) | |
Persist brightness level of flashlight, and start as on
| -rw-r--r-- | src/displayapp/screens/FlashLight.cpp | 6 | ||||
| -rw-r--r-- | src/displayapp/screens/FlashLight.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/displayapp/screens/FlashLight.cpp b/src/displayapp/screens/FlashLight.cpp index dba79a4..266e089 100644 --- a/src/displayapp/screens/FlashLight.cpp +++ b/src/displayapp/screens/FlashLight.cpp @@ -9,6 +9,9 @@ namespace { auto* screen = static_cast<FlashLight*>(obj->user_data); screen->OnClickEvent(obj, event); } + + Pinetime::Controllers::BrightnessController::Levels brightnessLevel = Pinetime::Controllers::BrightnessController::Levels::High; + } FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app, @@ -21,7 +24,6 @@ FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app, { brightnessController.Backup(); - brightnessLevel = brightnessController.Level(); flashLight = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(flashLight, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont2); @@ -39,6 +41,8 @@ FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app, lv_obj_align(indicators[2], indicators[1], LV_ALIGN_OUT_RIGHT_MID, 8, 0); SetIndicators(); + // brightnessLevel = brightnessController.Level(); + brightnessController.Set(brightnessLevel); SetColors(); backgroundAction = lv_label_create(lv_scr_act(), nullptr); diff --git a/src/displayapp/screens/FlashLight.h b/src/displayapp/screens/FlashLight.h index e91a103..ebc69f7 100644 --- a/src/displayapp/screens/FlashLight.h +++ b/src/displayapp/screens/FlashLight.h @@ -26,12 +26,10 @@ namespace Pinetime { Pinetime::System::SystemTask& systemTask; Controllers::BrightnessController& brightnessController; - Controllers::BrightnessController::Levels brightnessLevel; - lv_obj_t* flashLight; lv_obj_t* backgroundAction; lv_obj_t* indicators[3]; - bool isOn = false; + bool isOn = true; }; } } |
