summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/FlashLight.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-10 08:31:53 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-10 08:42:51 (GMT)
commitb2be5344958d38fb362bab3691fc104f0f049853 (patch)
tree66c50ca682cc43e379981c2676ba9486539d47d0 /src/displayapp/screens/FlashLight.cpp
parentc5650a55562272aa6f4e0bdb1b78a814128b306d (diff)
Persist brightness level of flashlight, and start as on
Diffstat (limited to 'src/displayapp/screens/FlashLight.cpp')
-rw-r--r--src/displayapp/screens/FlashLight.cpp6
1 files changed, 5 insertions, 1 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);