Strong typedef: Use strong typedefs for date, date tick, minutes types

Add delta types
Adjust/add type conversion functions
Add various utility methods on types
Remove the various minute macros
Fix some minute conversion inconsistencies
This commit is contained in:
Jonathan G Rennison
2023-12-19 01:03:18 +00:00
parent 1e7b56e13a
commit 03e0ec8276
80 changed files with 538 additions and 431 deletions

View File

@@ -59,7 +59,7 @@ struct StatusBarWindow : Window {
int ticker_scroll;
GUITimer ticker_timer;
GUITimer reminder_timeout;
int64 last_minute = 0;
TickMinutes last_minute = 0;
static const int TICKER_STOP = 1640; ///< scrolling is finished when counter reaches this value
static const int REMINDER_START = 1350; ///< time in ms for reminder notification (red dot on the right) to stay
@@ -211,9 +211,12 @@ struct StatusBarWindow : Window {
{
if (_pause_mode != PM_UNPAUSED) return;
if (_settings_time.time_in_minutes && this->last_minute != CURRENT_MINUTE) {
this->last_minute = CURRENT_MINUTE;
this->SetWidgetDirty(WID_S_LEFT);
if (_settings_time.time_in_minutes) {
const TickMinutes now = _settings_time.NowInTickMinutes();
if (this->last_minute != now) {
this->last_minute = now;
this->SetWidgetDirty(WID_S_LEFT);
}
}
if (this->ticker_scroll < TICKER_STOP) { // Scrolling text