Cleaned up redundant if statements, spacing
Removed redundant if statements in hour button logic. Spacing is now in line with repo guidelines.
This commit is contained in:
parent
698288d822
commit
2bc338ceed
|
@ -161,7 +161,6 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
|
|||
else {
|
||||
is24H = false;
|
||||
}
|
||||
|
||||
if (object == btnHoursPlus) {
|
||||
hoursValue++;
|
||||
if (hoursValue > 23)
|
||||
|
@ -171,10 +170,8 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
|
|||
lv_label_set_text(lblampm, "AM");
|
||||
else
|
||||
lv_label_set_text(lblampm, "PM");
|
||||
}
|
||||
if (!is24H)
|
||||
lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue));
|
||||
else
|
||||
} else
|
||||
lv_label_set_text_fmt(lblHours, "%02d", hoursValue);
|
||||
lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED);
|
||||
} else if (object == btnHoursMinus) {
|
||||
|
@ -186,10 +183,8 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
|
|||
lv_label_set_text(lblampm, "AM");
|
||||
else
|
||||
lv_label_set_text(lblampm, "PM");
|
||||
}
|
||||
if (!is24H)
|
||||
lv_label_set_text_fmt(lblHours, "%02d", timeConvert(hoursValue));
|
||||
else
|
||||
} else
|
||||
lv_label_set_text_fmt(lblHours, "%02d", hoursValue);
|
||||
lv_btn_set_state(btnSetTime, LV_BTN_STATE_RELEASED);
|
||||
} else if (object == btnMinutesPlus) {
|
||||
|
@ -217,3 +212,4 @@ void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
|
|||
lv_btn_set_state(btnSetTime, LV_BTN_STATE_DISABLED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue