summaryrefslogtreecommitdiff
path: root/src/displayapp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-08-28 17:25:50 +0300
committerRiku Isokoski <riksu9000@gmail.com>2021-08-28 17:25:50 +0300
commitc2fae47391f02b515c8d85a00ae1b7190bcd30a0 (patch)
tree75c4b96ace962cbb965c2bdd0dd11137b471c5ac /src/displayapp
parent3cef05b7451fca3b2bbd5e96714c0262d52ac4d1 (diff)
parentfab49f8557ef8ff38fe4f607e33b18fb5a1aeb9a (diff)
Merge branch 'develop' into refresh_rework
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/DisplayApp.cpp70
-rw-r--r--src/displayapp/DisplayApp.h11
-rw-r--r--src/displayapp/DisplayAppRecovery.cpp4
-rw-r--r--src/displayapp/DisplayAppRecovery.h6
-rw-r--r--src/displayapp/DummyLittleVgl.h3
-rw-r--r--src/displayapp/LittleVgl.cpp30
-rw-r--r--src/displayapp/LittleVgl.h2
-rw-r--r--src/displayapp/screens/FirmwareValidation.cpp4
-rw-r--r--src/displayapp/screens/InfiniPaint.cpp3
-rw-r--r--src/displayapp/screens/List.cpp2
-rw-r--r--src/displayapp/screens/Metronome.cpp3
-rw-r--r--src/displayapp/screens/Music.cpp2
-rw-r--r--src/displayapp/screens/Paddle.cpp4
-rw-r--r--src/displayapp/screens/Screen.h1
-rw-r--r--src/displayapp/screens/StopWatch.cpp4
-rw-r--r--src/displayapp/screens/SystemInfo.cpp6
-rw-r--r--src/displayapp/screens/Tile.cpp1
-rw-r--r--src/displayapp/screens/settings/QuickSettings.cpp6
-rw-r--r--src/displayapp/screens/settings/SettingDisplay.cpp2
19 files changed, 66 insertions, 98 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index f9d6dc9e..4aa18985 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -53,29 +53,26 @@ namespace {
return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0;
}
- TouchEvents Convert(Pinetime::Drivers::Cst816S::TouchInfos info) {
- if (info.isTouch) {
- switch (info.gesture) {
- case Pinetime::Drivers::Cst816S::Gestures::SingleTap:
- return TouchEvents::Tap;
- case Pinetime::Drivers::Cst816S::Gestures::LongPress:
- return TouchEvents::LongTap;
- case Pinetime::Drivers::Cst816S::Gestures::DoubleTap:
- return TouchEvents::DoubleTap;
- case Pinetime::Drivers::Cst816S::Gestures::SlideRight:
- return TouchEvents::SwipeRight;
- case Pinetime::Drivers::Cst816S::Gestures::SlideLeft:
- return TouchEvents::SwipeLeft;
- case Pinetime::Drivers::Cst816S::Gestures::SlideDown:
- return TouchEvents::SwipeDown;
- case Pinetime::Drivers::Cst816S::Gestures::SlideUp:
- return TouchEvents::SwipeUp;
- case Pinetime::Drivers::Cst816S::Gestures::None:
- default:
- return TouchEvents::None;
- }
+ TouchEvents ConvertGesture(Pinetime::Drivers::Cst816S::Gestures gesture) {
+ switch (gesture) {
+ case Pinetime::Drivers::Cst816S::Gestures::SingleTap:
+ return TouchEvents::Tap;
+ case Pinetime::Drivers::Cst816S::Gestures::LongPress:
+ return TouchEvents::LongTap;
+ case Pinetime::Drivers::Cst816S::Gestures::DoubleTap:
+ return TouchEvents::DoubleTap;
+ case Pinetime::Drivers::Cst816S::Gestures::SlideRight:
+ return TouchEvents::SwipeRight;
+ case Pinetime::Drivers::Cst816S::Gestures::SlideLeft:
+ return TouchEvents::SwipeLeft;
+ case Pinetime::Drivers::Cst816S::Gestures::SlideDown:
+ return TouchEvents::SwipeDown;
+ case Pinetime::Drivers::Cst816S::Gestures::SlideUp:
+ return TouchEvents::SwipeUp;
+ case Pinetime::Drivers::Cst816S::Gestures::None:
+ default:
+ return TouchEvents::None;
}
- return TouchEvents::None;
}
}
@@ -91,7 +88,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Controllers::Settings& settingsController,
Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController,
- Pinetime::Controllers::TimerController& timerController)
+ Pinetime::Controllers::TimerController& timerController,
+ Pinetime::Controllers::TouchHandler& touchHandler)
: lcd {lcd},
lvgl {lvgl},
touchPanel {touchPanel},
@@ -104,7 +102,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
settingsController {settingsController},
motorController {motorController},
motionController {motionController},
- timerController {timerController} {
+ timerController {timerController},
+ touchHandler {touchHandler} {
}
void DisplayApp::Start() {
@@ -212,8 +211,7 @@ void DisplayApp::Refresh() {
if (state != States::Running) {
break;
}
- auto info = touchPanel.GetTouchInfo();
- auto gesture = Convert(info);
+ auto gesture = ConvertGesture(touchHandler.GestureGet());
if (gesture == TouchEvents::None) {
break;
}
@@ -239,11 +237,9 @@ void DisplayApp::Refresh() {
LoadApp(returnToApp, returnDirection);
brightnessController.Set(settingsController.GetBrightness());
brightnessController.Backup();
- } else if (touchMode == TouchModes::Gestures) {
- if (gesture == TouchEvents::Tap) {
- lvgl.SetNewTapEvent(info.x, info.y);
- }
}
+ } else {
+ touchHandler.CancelTap();
}
} break;
case Messages::ButtonPushed:
@@ -273,13 +269,8 @@ void DisplayApp::Refresh() {
nextApp = Apps::None;
}
- if (state != States::Idle && touchMode == TouchModes::Polling) {
- auto info = touchPanel.GetTouchInfo();
- if (info.action == 2) { // 2 = contact
- if (!currentScreen->OnTouchEvent(info.x, info.y)) {
- lvgl.SetNewTapEvent(info.x, info.y);
- }
- }
+ if (touchHandler.IsTouching()) {
+ currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY());
}
}
@@ -302,6 +293,7 @@ void DisplayApp::ReturnApp(Apps app, DisplayApp::FullRefreshDirections direction
}
void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) {
+ touchHandler.CancelTap();
currentScreen.reset(nullptr);
SetFullRefresh(direction);
@@ -467,10 +459,6 @@ void DisplayApp::SetFullRefresh(DisplayApp::FullRefreshDirections direction) {
}
}
-void DisplayApp::SetTouchMode(DisplayApp::TouchModes mode) {
- touchMode = mode;
-}
-
void DisplayApp::PushMessageToSystemTask(Pinetime::System::Messages message) {
if (systemTask != nullptr)
systemTask->PushMessage(message);
diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h
index 574be63f..96951d1c 100644
--- a/src/displayapp/DisplayApp.h
+++ b/src/displayapp/DisplayApp.h
@@ -14,6 +14,7 @@
#include "components/settings/Settings.h"
#include "displayapp/screens/Screen.h"
#include "components/timer/TimerController.h"
+#include "touchhandler/TouchHandler.h"
#include "Messages.h"
namespace Pinetime {
@@ -31,6 +32,7 @@ namespace Pinetime {
class NotificationManager;
class HeartRateController;
class MotionController;
+ class TouchHandler;
}
namespace System {
@@ -41,7 +43,6 @@ namespace Pinetime {
public:
enum class States { Idle, Running };
enum class FullRefreshDirections { None, Up, Down, Left, Right, LeftAnim, RightAnim };
- enum class TouchModes { Gestures, Polling };
DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& lvgl,
@@ -55,14 +56,14 @@ namespace Pinetime {
Controllers::Settings& settingsController,
Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController,
- Pinetime::Controllers::TimerController& timerController);
+ Pinetime::Controllers::TimerController& timerController,
+ Pinetime::Controllers::TouchHandler& touchHandler);
void Start();
void PushMessage(Display::Messages msg);
void StartApp(Apps app, DisplayApp::FullRefreshDirections direction);
void SetFullRefresh(FullRefreshDirections direction);
- void SetTouchMode(TouchModes mode);
void Register(Pinetime::System::SystemTask* systemTask);
@@ -81,6 +82,7 @@ namespace Pinetime {
Pinetime::Controllers::MotorController& motorController;
Pinetime::Controllers::MotionController& motionController;
Pinetime::Controllers::TimerController& timerController;
+ Pinetime::Controllers::TouchHandler& touchHandler;
Pinetime::Controllers::FirmwareValidator validator;
Controllers::BrightnessController brightnessController;
@@ -100,8 +102,7 @@ namespace Pinetime {
FullRefreshDirections returnDirection = FullRefreshDirections::None;
TouchEvents returnTouchEvent = TouchEvents::None;
- TouchModes touchMode = TouchModes::Gestures;
-
+ TouchEvents GetGesture();
void RunningState();
void IdleState();
static void Process(void* instance);
diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp
index fd517b11..17612ef0 100644
--- a/src/displayapp/DisplayAppRecovery.cpp
+++ b/src/displayapp/DisplayAppRecovery.cpp
@@ -3,6 +3,7 @@
#include <task.h>
#include <libraries/log/nrf_log.h>
#include <components/rle/RleDecoder.h>
+#include <touchhandler/TouchHandler.h>
#include "displayapp/icons/infinitime/infinitime-nb.c"
using namespace Pinetime::Applications;
@@ -19,7 +20,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Controllers::Settings& settingsController,
Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController,
- Pinetime::Controllers::TimerController& timerController)
+ Pinetime::Controllers::TimerController& timerController,
+ Pinetime::Controllers::TouchHandler& touchHandler)
: lcd {lcd}, bleController {bleController} {
}
diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h
index 638c0071..8b2bc7f5 100644
--- a/src/displayapp/DisplayAppRecovery.h
+++ b/src/displayapp/DisplayAppRecovery.h
@@ -29,6 +29,9 @@ namespace Pinetime {
namespace System {
class SystemTask;
};
+ namespace Controllers {
+ class TouchHandler;
+ }
namespace Applications {
class DisplayApp {
public:
@@ -44,7 +47,8 @@ namespace Pinetime {
Controllers::Settings& settingsController,
Pinetime::Controllers::MotorController& motorController,
Pinetime::Controllers::MotionController& motionController,
- Pinetime::Controllers::TimerController& timerController);
+ Pinetime::Controllers::TimerController& timerController,
+ Pinetime::Controllers::TouchHandler& touchHandler);
void Start();
void PushMessage(Pinetime::Applications::Display::Messages msg);
void Register(Pinetime::System::SystemTask* systemTask);
diff --git a/src/displayapp/DummyLittleVgl.h b/src/displayapp/DummyLittleVgl.h
index 016165b8..1db51343 100644
--- a/src/displayapp/DummyLittleVgl.h
+++ b/src/displayapp/DummyLittleVgl.h
@@ -32,6 +32,9 @@ namespace Pinetime {
}
void SetNewTapEvent(uint16_t x, uint16_t y) {
}
+ void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) {
+
+ }
};
}
}
diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp
index c069afa2..2bd5e57b 100644
--- a/src/displayapp/LittleVgl.cpp
+++ b/src/displayapp/LittleVgl.cpp
@@ -166,43 +166,21 @@ void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) {
lv_disp_flush_ready(&disp_drv);
}
-void LittleVgl::SetNewTapEvent(uint16_t x, uint16_t y) {
+void LittleVgl::SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) {
tap_x = x;
tap_y = y;
- tapped = true;
+ tapped = contact;
}
bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
+ ptr->point.x = tap_x;
+ ptr->point.y = tap_y;
if (tapped) {
- ptr->point.x = tap_x;
- ptr->point.y = tap_y;
ptr->state = LV_INDEV_STATE_PR;
- tapped = false;
} else {
ptr->state = LV_INDEV_STATE_REL;
}
return false;
- /*
- auto info = touchPanel.GetTouchInfo();
-
- if((previousClick.x != info.x || previousClick.y != info.y) &&
- (info.gesture == Drivers::Cst816S::Gestures::SingleTap)) {
- // TODO For an unknown reason, the first touch is taken twice into account.
- // 'firstTouch' is a quite'n'dirty workaound until I find a better solution
- if(firstTouch) ptr->state = LV_INDEV_STATE_REL;
- else ptr->state = LV_INDEV_STATE_PR;
- firstTouch = false;
- previousClick.x = info.x;
- previousClick.y = info.y;
- }
- else {
- ptr->state = LV_INDEV_STATE_REL;
- }
-
- ptr->point.x = info.x;
- ptr->point.y = info.y;
- return false;
- */
}
void LittleVgl::InitTheme() {
diff --git a/src/displayapp/LittleVgl.h b/src/displayapp/LittleVgl.h
index 41f934a7..1f8a3d79 100644
--- a/src/displayapp/LittleVgl.h
+++ b/src/displayapp/LittleVgl.h
@@ -24,7 +24,7 @@ namespace Pinetime {
void FlushDisplay(const lv_area_t* area, lv_color_t* color_p);
bool GetTouchPadInfo(lv_indev_data_t* ptr);
void SetFullRefresh(FullRefreshDirections direction);
- void SetNewTapEvent(uint16_t x, uint16_t y);
+ void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact);
private:
void InitDisplay();
diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp
index 1ad1b8b2..eef8f919 100644
--- a/src/displayapp/screens/FirmwareValidation.cpp
+++ b/src/displayapp/screens/FirmwareValidation.cpp
@@ -64,10 +64,10 @@ FirmwareValidation::~FirmwareValidation() {
}
void FirmwareValidation::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
- if (object == buttonValidate && event == LV_EVENT_PRESSED) {
+ if (object == buttonValidate && event == LV_EVENT_CLICKED) {
validator.Validate();
running = false;
- } else if (object == buttonReset && event == LV_EVENT_PRESSED) {
+ } else if (object == buttonReset && event == LV_EVENT_CLICKED) {
validator.Reset();
}
}
diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp
index 4dde81a4..85a5e826 100644
--- a/src/displayapp/screens/InfiniPaint.cpp
+++ b/src/displayapp/screens/InfiniPaint.cpp
@@ -5,13 +5,10 @@
using namespace Pinetime::Applications::Screens;
InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl {lvgl} {
- app->SetTouchMode(DisplayApp::TouchModes::Polling);
std::fill(b, b + bufferSize, selectColor);
}
InfiniPaint::~InfiniPaint() {
- // Reset the touchmode
- app->SetTouchMode(DisplayApp::TouchModes::Gestures);
lv_obj_clean(lv_scr_act());
}
diff --git a/src/displayapp/screens/List.cpp b/src/displayapp/screens/List.cpp
index c064a9cf..064b47a6 100644
--- a/src/displayapp/screens/List.cpp
+++ b/src/displayapp/screens/List.cpp
@@ -99,7 +99,7 @@ List::~List() {
}
void List::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
- if (event == LV_EVENT_RELEASED) {
+ if (event == LV_EVENT_CLICKED) {
for (int i = 0; i < MAXLISTITEMS; i++) {
if (apps[i] != Apps::None && object == itemApps[i]) {
app->StartApp(apps[i], DisplayApp::FullRefreshDirections::Up);
diff --git a/src/displayapp/screens/Metronome.cpp b/src/displayapp/screens/Metronome.cpp
index 4396e360..884a4a51 100644
--- a/src/displayapp/screens/Metronome.cpp
+++ b/src/displayapp/screens/Metronome.cpp
@@ -67,14 +67,11 @@ Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorControl
lv_obj_align(playPause, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
lv_obj_set_style_local_value_str(playPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Symbols::play);
- app->SetTouchMode(DisplayApp::TouchModes::Polling);
-
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
}
Metronome::~Metronome() {
lv_task_del(taskRefresh);
- app->SetTouchMode(DisplayApp::TouchModes::Gestures);
systemTask.PushMessage(System::Messages::EnableSleeping);
lv_obj_clean(lv_scr_act());
}
diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp
index 8b7a23c1..47ddb655 100644
--- a/src/displayapp/screens/Music.cpp
+++ b/src/displayapp/screens/Music.cpp
@@ -293,7 +293,7 @@ bool Music::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
return true;
}
default: {
- return true;
+ return false;
}
}
}
diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp
index d43173dc..3b6d60e3 100644
--- a/src/displayapp/screens/Paddle.cpp
+++ b/src/displayapp/screens/Paddle.cpp
@@ -5,8 +5,6 @@
using namespace Pinetime::Applications::Screens;
Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl {lvgl} {
- app->SetTouchMode(DisplayApp::TouchModes::Polling);
-
background = lv_obj_create(lv_scr_act(), nullptr);
lv_obj_set_size(background, LV_HOR_RES + 1, LV_VER_RES);
lv_obj_set_pos(background, -1, 0);
@@ -35,8 +33,6 @@ Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::Li
Paddle::~Paddle() {
lv_task_del(taskRefresh);
- // Reset the touchmode
- app->SetTouchMode(DisplayApp::TouchModes::Gestures);
lv_obj_clean(lv_scr_act());
}
diff --git a/src/displayapp/screens/Screen.h b/src/displayapp/screens/Screen.h
index 0a5588b1..ce5741b2 100644
--- a/src/displayapp/screens/Screen.h
+++ b/src/displayapp/screens/Screen.h
@@ -60,6 +60,7 @@ namespace Pinetime {
}
/** @return false if the event hasn't been handled by the app, true if it has been handled */
+ // Returning true will cancel lvgl tap
virtual bool OnTouchEvent(TouchEvents event) {
return false;
}
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp
index 0d4feb20..9b27a89d 100644
--- a/src/displayapp/screens/StopWatch.cpp
+++ b/src/displayapp/screens/StopWatch.cpp
@@ -162,7 +162,7 @@ void StopWatch::Refresh() {
}
void StopWatch::playPauseBtnEventHandler(lv_event_t event) {
- if (event != LV_EVENT_PRESSED) {
+ if (event != LV_EVENT_CLICKED) {
return;
}
if (currentState == States::Init) {
@@ -175,7 +175,7 @@ void StopWatch::playPauseBtnEventHandler(lv_event_t event) {
}
void StopWatch::stopLapBtnEventHandler(lv_event_t event) {
- if (event != LV_EVENT_PRESSED) {
+ if (event != LV_EVENT_CLICKED) {
return;
}
// If running, then this button is used to save laps
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index a0aef9a4..b7a4fc60 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -200,7 +200,7 @@ bool SystemInfo::sortById(const TaskStatus_t& lhs, const TaskStatus_t& rhs) {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
- TaskStatus_t tasksStatus[7];
+ TaskStatus_t tasksStatus[10];
lv_obj_t* infoTask = lv_table_create(lv_scr_act(), NULL);
lv_table_set_col_cnt(infoTask, 4);
lv_table_set_row_cnt(infoTask, 8);
@@ -215,9 +215,9 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
lv_table_set_cell_value(infoTask, 0, 3, "Free");
lv_table_set_col_width(infoTask, 3, 90);
- auto nb = uxTaskGetSystemState(tasksStatus, 7, nullptr);
+ auto nb = uxTaskGetSystemState(tasksStatus, sizeof(tasksStatus) / sizeof(tasksStatus[0]), nullptr);
std::sort(tasksStatus, tasksStatus + nb, sortById);
- for (uint8_t i = 0; i < nb; i++) {
+ for (uint8_t i = 0; i < nb && i < 7; i++) {
lv_table_set_cell_value(infoTask, i + 1, 0, std::to_string(tasksStatus[i].xTaskNumber).c_str());
char state[2] = {0};
diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp
index 85bd2c5f..1d4f0d0e 100644
--- a/src/displayapp/screens/Tile.cpp
+++ b/src/displayapp/screens/Tile.cpp
@@ -95,6 +95,7 @@ Tile::Tile(uint8_t screenID,
lv_obj_set_style_local_pad_inner(btnm1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 10);
for (uint8_t i = 0; i < 6; i++) {
+ lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_CLICK_TRIG);
if (applications[i].application == Apps::None) {
lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_DISABLED);
}
diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp
index 4f5ecd4d..22b56360 100644
--- a/src/displayapp/screens/settings/QuickSettings.cpp
+++ b/src/displayapp/screens/settings/QuickSettings.cpp
@@ -128,12 +128,12 @@ void QuickSettings::UpdateScreen() {
}
void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
- if (object == btn2 && event == LV_EVENT_PRESSED) {
+ if (object == btn2 && event == LV_EVENT_CLICKED) {
running = false;
app->StartApp(Apps::FlashLight, DisplayApp::FullRefreshDirections::None);
- } else if (object == btn1 && event == LV_EVENT_PRESSED) {
+ } else if (object == btn1 && event == LV_EVENT_CLICKED) {
brightness.Step();
lv_label_set_text_static(btn1_lvl, brightness.GetIcon());
@@ -150,7 +150,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOff);
}
- } else if (object == btn4 && event == LV_EVENT_PRESSED) {
+ } else if (object == btn4 && event == LV_EVENT_CLICKED) {
running = false;
settingsController.SetSettingsMenu(0);
app->StartApp(Apps::Settings, DisplayApp::FullRefreshDirections::Up);
diff --git a/src/displayapp/screens/settings/SettingDisplay.cpp b/src/displayapp/screens/settings/SettingDisplay.cpp
index 7b31c47c..d8d6c767 100644
--- a/src/displayapp/screens/settings/SettingDisplay.cpp
+++ b/src/displayapp/screens/settings/SettingDisplay.cpp
@@ -81,7 +81,7 @@ SettingDisplay::~SettingDisplay() {
}
void SettingDisplay::UpdateSelected(lv_obj_t* object, lv_event_t event) {
- if (event == LV_EVENT_VALUE_CHANGED) {
+ if (event == LV_EVENT_CLICKED) {
for (int i = 0; i < optionsTotal; i++) {
if (object == cbOption[i]) {
lv_checkbox_set_checked(cbOption[i], true);