summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens')
-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/ScreenList.h2
-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.cpp4
13 files changed, 17 insertions, 25 deletions
diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp
index 233ebd5b..34a43a9f 100644
--- a/src/displayapp/screens/FirmwareValidation.cpp
+++ b/src/displayapp/screens/FirmwareValidation.cpp
@@ -68,10 +68,10 @@ bool FirmwareValidation::Refresh() {
}
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 32240084..58bfa558 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 eb53820b..91cab9f0 100644
--- a/src/displayapp/screens/List.cpp
+++ b/src/displayapp/screens/List.cpp
@@ -104,7 +104,7 @@ bool List::Refresh() {
}
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 66f8f621..5fbe5f36 100644
--- a/src/displayapp/screens/Metronome.cpp
+++ b/src/displayapp/screens/Metronome.cpp
@@ -66,12 +66,9 @@ Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorControl
lv_obj_set_size(playPause, 115, 50);
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);
}
Metronome::~Metronome() {
- 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 99a1518e..257e9aea 100644
--- a/src/displayapp/screens/Music.cpp
+++ b/src/displayapp/screens/Music.cpp
@@ -292,7 +292,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 5a939ac7..79e0c3d3 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);
@@ -32,8 +30,6 @@ Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::Li
}
Paddle::~Paddle() {
- // 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 6c9110c6..420f2015 100644
--- a/src/displayapp/screens/Screen.h
+++ b/src/displayapp/screens/Screen.h
@@ -64,6 +64,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/ScreenList.h b/src/displayapp/screens/ScreenList.h
index ea66bfb2..50d66328 100644
--- a/src/displayapp/screens/ScreenList.h
+++ b/src/displayapp/screens/ScreenList.h
@@ -110,4 +110,4 @@ namespace Pinetime {
};
}
}
-} \ No newline at end of file
+}
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp
index f4db5d6e..e3db6299 100644
--- a/src/displayapp/screens/StopWatch.cpp
+++ b/src/displayapp/screens/StopWatch.cpp
@@ -161,7 +161,7 @@ bool StopWatch::Refresh() {
}
void StopWatch::playPauseBtnEventHandler(lv_event_t event) {
- if (event != LV_EVENT_PRESSED) {
+ if (event != LV_EVENT_CLICKED) {
return;
}
if (currentState == States::Init) {
@@ -174,7 +174,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 ca9a4e7c..c45cc6b8 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -213,7 +213,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);
@@ -228,9 +228,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 777b5bb7..2ffbfbc2 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 54e2f3e2..8190f9d7 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 4954185d..aaf6a9f0 100644
--- a/src/displayapp/screens/settings/SettingDisplay.cpp
+++ b/src/displayapp/screens/settings/SettingDisplay.cpp
@@ -85,7 +85,7 @@ bool SettingDisplay::Refresh() {
}
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);
@@ -110,4 +110,4 @@ void SettingDisplay::UpdateSelected(lv_obj_t* object, lv_event_t event) {
}
}
}
-} \ No newline at end of file
+}