summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Alarm.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-11-11 09:08:20 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-11-11 09:08:20 (GMT)
commitf6d0ec49e6f2669c64729b081eb3342f02151f4a (patch)
tree7e21c83726bd3e0d18ec4ebe871274b1dbe2eb38 /src/displayapp/screens/Alarm.cpp
parentf41aaad6836ae348d1b5b084b4533b636f516b93 (diff)
parenta57fda6ba4a29866083a1254ffdf92939d00e182 (diff)
Merge branch 'develop'
# Conflicts: # doc/buildAndProgram.md
Diffstat (limited to 'src/displayapp/screens/Alarm.cpp')
-rw-r--r--src/displayapp/screens/Alarm.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp
index 959cb0b..6b45a36 100644
--- a/src/displayapp/screens/Alarm.cpp
+++ b/src/displayapp/screens/Alarm.cpp
@@ -120,10 +120,7 @@ void Alarm::OnButtonEvent(lv_obj_t* obj, lv_event_t event) {
return;
}
if (obj == btnMessage) {
- lv_obj_del(txtMessage);
- lv_obj_del(btnMessage);
- txtMessage = nullptr;
- btnMessage = nullptr;
+ HideInfo();
return;
}
// If any other button was pressed, disable the alarm
@@ -174,6 +171,14 @@ void Alarm::OnButtonEvent(lv_obj_t* obj, lv_event_t event) {
}
}
+bool Alarm::OnButtonPushed() {
+ if (txtMessage != nullptr && btnMessage != nullptr) {
+ HideInfo();
+ return true;
+ }
+ return false;
+}
+
void Alarm::UpdateAlarmTime() {
lv_label_set_text_fmt(time, "%02d:%02d", alarmHours, alarmMinutes);
alarmController.SetAlarmTime(alarmHours, alarmMinutes);
@@ -224,6 +229,12 @@ void Alarm::ShowInfo() {
}
}
+void Alarm::HideInfo() {
+ lv_obj_del(btnMessage);
+ txtMessage = nullptr;
+ btnMessage = nullptr;
+}
+
void Alarm::SetRecurButtonState() {
using Pinetime::Controllers::AlarmController;
switch (alarmController.Recurrence()) {