Merge branch 'develop' into update_touch_driver
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -292,7 +292,7 @@ bool Music::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -110,4 +110,4 @@ namespace Pinetime {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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};
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user