Merge branch 'v14' of https://gitea.locker98.com/josh/InfiniTime into v14
This commit is contained in:
commit
27d5584aa6
@ -57,14 +57,14 @@ WatchFaceHorizon::WatchFaceHorizon(Controllers::DateTime& dateTimeController,
|
||||
lv_line_set_points(lineBatteryFg, lineBatteryFgPoints, 2);
|
||||
|
||||
// Hour indicator lines at bottom
|
||||
for (int i = 0; i < 24; i++) {
|
||||
for (int i = 0; i < 60; i++) {
|
||||
hourLines[i] = lv_line_create(lv_scr_act(), nullptr);
|
||||
lv_style_init(&hourLineStyles[i]);
|
||||
lv_style_set_line_width(&hourLineStyles[i], LV_STATE_DEFAULT, 5);
|
||||
lv_style_set_line_color(&hourLineStyles[i], LV_STATE_DEFAULT, lv_color_hex(hourlyColors[i]));
|
||||
lv_obj_add_style(hourLines[i], LV_LINE_PART_MAIN, &hourLineStyles[i]);
|
||||
hourLinePoints[i][0] = {static_cast<lv_coord_t>(i * 10), 237};
|
||||
hourLinePoints[i][1] = {static_cast<lv_coord_t>((i + 1) * 10), 237};
|
||||
hourLinePoints[i][0] = {static_cast<lv_coord_t>(i * 4), 237};
|
||||
hourLinePoints[i][1] = {static_cast<lv_coord_t>((i + 1) * 4), 237};
|
||||
lv_line_set_points(hourLines[i], hourLinePoints[i], 2);
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ WatchFaceHorizon::~WatchFaceHorizon() {
|
||||
lv_style_reset(&lineBatteryFgStyle);
|
||||
lv_style_reset(&lineBatteryBgStyle);
|
||||
|
||||
for (int i = 0; i < 24; i++) {
|
||||
for (int i = 0; i < 60; i++) {
|
||||
lv_style_reset(&hourLineStyles[i]);
|
||||
}
|
||||
|
||||
@ -150,6 +150,7 @@ void WatchFaceHorizon::Refresh() {
|
||||
uint8_t hour = dateTimeController.Hours();
|
||||
uint8_t minute = dateTimeController.Minutes();
|
||||
uint8_t day = dateTimeController.Day();
|
||||
uint8_t second = dateTimeController.Seconds();
|
||||
|
||||
char minutesChar[3];
|
||||
sprintf(minutesChar, "%02d", static_cast<int>(minute));
|
||||
@ -187,8 +188,8 @@ void WatchFaceHorizon::Refresh() {
|
||||
lv_label_set_text_fmt(labelHourSecondDigit, "%c", hoursChar[1]);
|
||||
|
||||
// Update hour bar on bottom
|
||||
for (int i = 0; i < 24; i++) {
|
||||
if (i <= hour) {
|
||||
for (int i = 0; i < 60; i++) {
|
||||
if (i <= second) {
|
||||
lv_obj_set_hidden(hourLines[i], false);
|
||||
} else {
|
||||
lv_obj_set_hidden(hourLines[i], true);
|
||||
|
@ -51,9 +51,9 @@ namespace Pinetime {
|
||||
|
||||
lv_obj_t* background;
|
||||
|
||||
lv_obj_t* hourLines[24];
|
||||
lv_style_t hourLineStyles[24];
|
||||
lv_point_t hourLinePoints[24][2];
|
||||
lv_obj_t* hourLines[60];
|
||||
lv_style_t hourLineStyles[60];
|
||||
lv_point_t hourLinePoints[60][2];
|
||||
|
||||
lv_obj_t* labelHourFirstDigit;
|
||||
lv_obj_t* labelHourSecondDigit;
|
||||
|
Loading…
Reference in New Issue
Block a user