Merge branch 'develop' into fix_touchevent_tap
This commit is contained in:
@@ -7,12 +7,12 @@ using namespace Pinetime::Applications::Screens;
|
||||
|
||||
namespace {
|
||||
static void ButtonEventHandler(lv_obj_t* obj, lv_event_t event) {
|
||||
QuickSettings* screen = static_cast<QuickSettings*>(obj->user_data);
|
||||
auto* screen = static_cast<QuickSettings*>(obj->user_data);
|
||||
screen->OnButtonEvent(obj, event);
|
||||
}
|
||||
|
||||
static void lv_update_task(struct _lv_task_t* task) {
|
||||
auto user_data = static_cast<QuickSettings*>(task->user_data);
|
||||
auto* user_data = static_cast<QuickSettings*>(task->user_data);
|
||||
user_data->UpdateScreen();
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
|
||||
lv_obj_set_pos(backgroundLabel, 0, 0);
|
||||
lv_label_set_text_static(backgroundLabel, "");
|
||||
|
||||
taskUpdate = lv_task_create(lv_update_task, 500000, LV_TASK_PRIO_MID, this);
|
||||
taskUpdate = lv_task_create(lv_update_task, 5000, LV_TASK_PRIO_MID, this);
|
||||
}
|
||||
|
||||
QuickSettings::~QuickSettings() {
|
||||
|
@@ -45,7 +45,7 @@ SettingSteps::SettingSteps(
|
||||
|
||||
stepValue = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_style_local_text_font(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
|
||||
lv_label_set_text_fmt(stepValue,"%i", settingsController.GetStepsGoal());
|
||||
lv_label_set_text_fmt(stepValue, "%lu", settingsController.GetStepsGoal());
|
||||
lv_label_set_align(stepValue, LV_LABEL_ALIGN_CENTER);
|
||||
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_CENTER, 0, -10);
|
||||
|
||||
@@ -81,7 +81,7 @@ void SettingSteps::UpdateSelected(lv_obj_t *object, lv_event_t event) {
|
||||
value += 1000;
|
||||
if ( value <= 500000 ) {
|
||||
settingsController.SetStepsGoal(value);
|
||||
lv_label_set_text_fmt(stepValue,"%i", settingsController.GetStepsGoal());
|
||||
lv_label_set_text_fmt(stepValue, "%lu", settingsController.GetStepsGoal());
|
||||
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_CENTER, 0, -10);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void SettingSteps::UpdateSelected(lv_obj_t *object, lv_event_t event) {
|
||||
value -= 1000;
|
||||
if ( value >= 1000 ) {
|
||||
settingsController.SetStepsGoal(value);
|
||||
lv_label_set_text_fmt(stepValue,"%i", settingsController.GetStepsGoal());
|
||||
lv_label_set_text_fmt(stepValue, "%lu", settingsController.GetStepsGoal());
|
||||
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_CENTER, 0, -10);
|
||||
}
|
||||
}
|
||||
|
@@ -58,6 +58,15 @@ SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, Pine
|
||||
lv_checkbox_set_checked(cbOption[optionsTotal], true);
|
||||
}
|
||||
|
||||
optionsTotal++;
|
||||
cbOption[optionsTotal] = lv_checkbox_create(container1, nullptr);
|
||||
lv_checkbox_set_text_static(cbOption[optionsTotal], " PineTimeStyle");
|
||||
cbOption[optionsTotal]->user_data = this;
|
||||
lv_obj_set_event_cb(cbOption[optionsTotal], event_handler);
|
||||
if (settingsController.GetClockFace() == 2) {
|
||||
lv_checkbox_set_checked(cbOption[optionsTotal], true);
|
||||
}
|
||||
|
||||
optionsTotal++;
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,7 @@ std::unique_ptr<Screen> Settings::CreateScreen1() {
|
||||
{Symbols::clock, "Watch face", Apps::SettingWatchFace},
|
||||
}};
|
||||
|
||||
return std::unique_ptr<Screen>(new Screens::List(0, 2, app, settingsController, applications));
|
||||
return std::make_unique<Screens::List>(0, 2, app, settingsController, applications);
|
||||
}
|
||||
|
||||
std::unique_ptr<Screen> Settings::CreateScreen2() {
|
||||
@@ -58,5 +58,5 @@ std::unique_ptr<Screen> Settings::CreateScreen2() {
|
||||
{Symbols::list, "About", Apps::SysInfo},
|
||||
}};
|
||||
|
||||
return std::unique_ptr<Screen>(new Screens::List(1, 2, app, settingsController, applications));
|
||||
return std::make_unique<Screens::List>(1, 2, app, settingsController, applications);
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@ namespace Pinetime {
|
||||
|
||||
bool Refresh() override;
|
||||
|
||||
void OnButtonEvent(lv_obj_t* object, lv_event_t event);
|
||||
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user