summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Timer.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-05-10 22:57:13 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-05-10 22:57:13 (GMT)
commit20bf019ed739231714620010248f7e9e409aa919 (patch)
treef487545ba633086678c6e0b2c6b0a85f40929612 /src/displayapp/screens/Timer.cpp
parent2f0858fa0561d09d59ab4435c0b4342794738a77 (diff)
Remove redundant code in Timer App; inline CreateButtons
Diffstat (limited to 'src/displayapp/screens/Timer.cpp')
-rw-r--r--src/displayapp/screens/Timer.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp
index 935dbe2..459d5f6 100644
--- a/src/displayapp/screens/Timer.cpp
+++ b/src/displayapp/screens/Timer.cpp
@@ -11,44 +11,6 @@ void Timer::btnEventHandler(lv_obj_t* obj, lv_event_t event) {
screen->OnButtonEvent(obj, event);
}
-void Timer::CreateButtons() {
- if (btnMinutesUp != nullptr) {
- return;
- }
-
- btnMinutesUp = lv_btn_create(lv_scr_act(), nullptr);
- btnMinutesUp->user_data = this;
- lv_obj_set_event_cb(btnMinutesUp, btnEventHandler);
- lv_obj_set_size(btnMinutesUp, 60, 40);
- lv_obj_align(btnMinutesUp, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 20, -85);
- txtMUp = lv_label_create(btnMinutesUp, nullptr);
- lv_label_set_text_static(txtMUp, "+");
-
- btnMinutesDown = lv_btn_create(lv_scr_act(), nullptr);
- btnMinutesDown->user_data = this;
- lv_obj_set_event_cb(btnMinutesDown, btnEventHandler);
- lv_obj_set_size(btnMinutesDown, 60, 40);
- lv_obj_align(btnMinutesDown, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 20, +35);
- txtMDown = lv_label_create(btnMinutesDown, nullptr);
- lv_label_set_text_static(txtMDown, "-");
-
- btnSecondsUp = lv_btn_create(lv_scr_act(), nullptr);
- btnSecondsUp->user_data = this;
- lv_obj_set_event_cb(btnSecondsUp, btnEventHandler);
- lv_obj_set_size(btnSecondsUp, 60, 40);
- lv_obj_align(btnSecondsUp, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -20, -85);
- txtSUp = lv_label_create(btnSecondsUp, nullptr);
- lv_label_set_text_static(txtSUp, "+");
-
- btnSecondsDown = lv_btn_create(lv_scr_act(), nullptr);
- btnSecondsDown->user_data = this;
- lv_obj_set_event_cb(btnSecondsDown, btnEventHandler);
- lv_obj_set_size(btnSecondsDown, 60, 40);
- lv_obj_align(btnSecondsDown, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -20, +35);
- txtSDown = lv_label_create(btnSecondsDown, nullptr);
- lv_label_set_text_static(txtSDown, "-");
-}
-
void Timer::Stop() {
int32_t secondsRemaining = timerController.GetSecondsRemaining();
if (timerController.IsOvertime()) {