cleanup code and fix 12hour time on digital face
This commit is contained in:
parent
2ffc63b1d8
commit
e4b4fba5a1
@ -48,10 +48,6 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
|
|||||||
|
|
||||||
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
|
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
|
||||||
|
|
||||||
/*label_time_ampm = lv_label_create(lv_scr_act(), nullptr);
|
|
||||||
lv_label_set_text_static(label_time_ampm, "");
|
|
||||||
lv_obj_align(label_time_ampm, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -30, -55);*/
|
|
||||||
|
|
||||||
heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
|
heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
|
||||||
lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat);
|
lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat);
|
||||||
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
|
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
|
||||||
@ -97,16 +93,11 @@ void WatchFaceDigital::Refresh() {
|
|||||||
uint8_t second = dateTimeController.Seconds();
|
uint8_t second = dateTimeController.Seconds();
|
||||||
|
|
||||||
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
|
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
|
||||||
/*char ampmChar[3] = "AM";
|
|
||||||
if (hour == 0) {
|
if (hour == 0) {
|
||||||
hour = 12;
|
hour = 12;
|
||||||
} else if (hour == 12) {
|
|
||||||
ampmChar[0] = 'P';
|
|
||||||
} else if (hour > 12) {
|
} else if (hour > 12) {
|
||||||
hour = hour - 12;
|
hour = hour - 12;
|
||||||
ampmChar[0] = 'P';
|
|
||||||
}
|
}
|
||||||
lv_label_set_text(label_time_ampm, ampmChar);*/
|
|
||||||
lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute);
|
lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute);
|
||||||
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
|
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,7 +54,6 @@ namespace Pinetime {
|
|||||||
|
|
||||||
lv_obj_t* label_time;
|
lv_obj_t* label_time;
|
||||||
lv_obj_t* label_seconds; //for secs
|
lv_obj_t* label_seconds; //for secs
|
||||||
//lv_obj_t* label_time_ampm;
|
|
||||||
lv_obj_t* batteryValue;
|
lv_obj_t* batteryValue;
|
||||||
lv_obj_t* label_date;
|
lv_obj_t* label_date;
|
||||||
lv_obj_t* heartbeatIcon;
|
lv_obj_t* heartbeatIcon;
|
||||||
|
Loading…
Reference in New Issue
Block a user