summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-03-31 13:40:02 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-03-31 13:40:02 (GMT)
commit92ce5ee9751f01dc63330ad25910c674420cd984 (patch)
tree3a373058774b12dcad5673f7cc116493e25282aa
parent99321f0cd3181d4cd6a00f69cd9b554c63c52849 (diff)
.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/displayapp/Apps.h1
-rw-r--r--src/displayapp/DisplayApp.cpp10
-rw-r--r--src/displayapp/screens/Alarm.cpp2
-rw-r--r--src/displayapp/screens/FlashLight.cpp1
-rw-r--r--src/displayapp/screens/StopWatch.cpp4
-rw-r--r--src/displayapp/screens/Timer.cpp1
-rw-r--r--src/systemtask/SystemTask.cpp6
8 files changed, 8 insertions, 19 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5f8da60..85db7fd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -387,7 +387,7 @@ list(APPEND SOURCE_FILES
displayapp/screens/Screen.cpp
displayapp/screens/Clock.cpp
displayapp/screens/Tile.cpp
- displayapp/screens/StopWatch.h
+ displayapp/screens/StopWatch.cpp
displayapp/screens/BatteryIcon.cpp
displayapp/screens/BleIcon.cpp
displayapp/screens/NotificationIcon.cpp
diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h
index 2ef5f13..b97080c 100644
--- a/src/displayapp/Apps.h
+++ b/src/displayapp/Apps.h
@@ -12,6 +12,7 @@ namespace Pinetime {
Notifications,
Alarm,
Timer,
+ StopWatch,
FlashLight,
QuickSettings,
Settings,
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 5a250b5..30b86ed 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -196,7 +196,7 @@ void DisplayApp::Refresh() {
auto* alarm = static_cast<Screens::Alarm*>(currentScreen.get());
alarm->SetAlerting();
} else {
- LoadApp(Apps::Alarm);
+ LoadApp(Apps::Alarm, DisplayApp::FullRefreshDirections::None);
}
break;
case Messages::TouchEvent: {
@@ -279,14 +279,14 @@ void DisplayApp::Refresh() {
}
}
+ if (touchHandler.IsTouching()) {
+ currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY());
+ }
+
if (nextApp != Apps::None) {
LoadApp(nextApp, nextDirection);
nextApp = Apps::None;
}
-
- if (touchHandler.IsTouching()) {
- currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY());
- }
}
void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) {
diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp
index 879e50d..2c9c14a 100644
--- a/src/displayapp/screens/Alarm.cpp
+++ b/src/displayapp/screens/Alarm.cpp
@@ -39,7 +39,6 @@ Alarm::Alarm(DisplayApp* app,
: Screen(app), alarmController {alarmController}, settingsController {settingsController}, systemTask {systemTask} {
time = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
alarmHours = alarmController.Hours();
@@ -49,7 +48,6 @@ Alarm::Alarm(DisplayApp* app,
lv_obj_align(time, lv_scr_act(), LV_ALIGN_CENTER, 0, -25);
lblampm = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_font(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_label_set_text_static(lblampm, " ");
lv_label_set_align(lblampm, LV_LABEL_ALIGN_CENTER);
diff --git a/src/displayapp/screens/FlashLight.cpp b/src/displayapp/screens/FlashLight.cpp
index c4d0264..cdd35b6 100644
--- a/src/displayapp/screens/FlashLight.cpp
+++ b/src/displayapp/screens/FlashLight.cpp
@@ -24,7 +24,6 @@ FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app,
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, &lv_font_sys_48);
lv_label_set_text_static(flashLight, Symbols::highlight);
lv_obj_align(flashLight, nullptr, LV_ALIGN_CENTER, 0, 0);
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp
index 8749839..92b37e0 100644
--- a/src/displayapp/screens/StopWatch.cpp
+++ b/src/displayapp/screens/StopWatch.cpp
@@ -53,13 +53,11 @@ StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask)
lapNr {} {
time = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_label_set_text(time, "00:00");
lv_obj_align(time, lv_scr_act(), LV_ALIGN_CENTER, 0, -45);
msecTime = lv_label_create(lv_scr_act(), nullptr);
- // lv_obj_set_style_local_text_font(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_label_set_text(msecTime, "00");
lv_obj_align(msecTime, lv_scr_act(), LV_ALIGN_CENTER, 0, 3);
@@ -87,13 +85,11 @@ StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask)
lv_obj_set_state(txtStopLap, LV_STATE_DISABLED);
lapOneText = lv_label_create(lv_scr_act(), nullptr);
- // lv_obj_set_style_local_text_font(lapOneText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(lapOneText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
lv_obj_align(lapOneText, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 50, 30);
lv_label_set_text(lapOneText, "");
lapTwoText = lv_label_create(lv_scr_act(), nullptr);
- // lv_obj_set_style_local_text_font(lapTwoText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(lapTwoText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
lv_obj_align(lapTwoText, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 50, 55);
lv_label_set_text(lapTwoText, "");
diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp
index a5e4019..3b21277 100644
--- a/src/displayapp/screens/Timer.cpp
+++ b/src/displayapp/screens/Timer.cpp
@@ -53,7 +53,6 @@ Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController)
: Screen(app), running {true}, timerController {timerController} {
time = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
uint32_t seconds = timerController.GetTimeRemaining() / 1000;
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 8e6f257..332dec9 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -378,13 +378,9 @@ void SystemTask::Work() {
motorController.RunForDuration(22);
}
break;
- case Messages::OnNewHalfHour:
+ case Messages::OnChime:
using Pinetime::Controllers::AlarmController;
if (settingsController.GetChimeOption() == Controllers::Settings::ChimesOption::HalfHours && alarmController.State() != AlarmController::AlarmState::Alerting) {
- if (isSleeping && !isWakingUp) {
- GoToRunning();
- displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock);
- }
motorController.RunForDuration(11);
}
break;