Reduce unnecessary status bar redraws

This commit is contained in:
Jonathan G Rennison
2020-02-13 18:42:40 +00:00
parent e41c85e8ec
commit 57f490db2b
3 changed files with 7 additions and 3 deletions

View File

@@ -81,6 +81,7 @@ struct StatusBarWindow : Window {
int ticker_scroll;
GUITimer ticker_timer;
GUITimer reminder_timeout;
int64 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
@@ -223,7 +224,8 @@ struct StatusBarWindow : Window {
{
if (_pause_mode != PM_UNPAUSED) return;
if (_settings_client.gui.time_in_minutes) {
if (_settings_client.gui.time_in_minutes && this->last_minute != CURRENT_MINUTE) {
this->last_minute = CURRENT_MINUTE;
this->SetWidgetDirty(WID_S_LEFT);
}