Major UI enhancements

This commit is contained in:
MCelliotG
2025-02-07 01:25:34 +02:00
committed by GitHub
parent 5ce7df8f97
commit 0c0eb76cdc
5 changed files with 216 additions and 157 deletions
+9 -9
View File
@@ -805,7 +805,7 @@ void showCT() {
} else if (hour > 12) {
hour -= 12; // Convert PM hours
}
sprintf(timeStr, "%d:%02d%s", hour, localtime(&t)->tm_min, ampm.c_str());
sprintf(timeStr, "%d:%02d %s", hour, localtime(&t)->tm_min, ampm.c_str());
} else { // Other regions: 24-hour format
strftime(timeStr, sizeof(timeStr), "%H:%M", localtime(&t));
}
@@ -828,17 +828,17 @@ void showCT() {
}
// Display the updated time and date
tftReplace(0, rds_clockold, rds_clock, 135, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_dateold, rds_date, 135, 16, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_dateold, rds_date, 134, 16, RDSColor, RDSColorSmooth, BackgroundColor, 16);
} else { // Handle dropout scenarios
if (rtcset) { // Display dropout message if RTC was set
tftReplace(0, rds_clockold, rds_clock, 135, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_dateold, rds_date, 135, 16, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(0, rds_dateold, rds_date, 134, 16, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
} else { // Clear and reprint the clock and date
tftPrint(0, rds_clockold, 135, 1, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_clock, 135, 1, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_dateold, 135, 16, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_date, 135, 16, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_clockold, 134, 1, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_clock, 134, 1, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_dateold, 134, 16, BackgroundColor, BackgroundColor, 16);
tftPrint(0, rds_date, 134, 16, BackgroundColor, BackgroundColor, 16);
}
}
}