diff --git a/app/core/application.cpp b/app/core/application.cpp index 8499c6c..8e620e6 100644 --- a/app/core/application.cpp +++ b/app/core/application.cpp @@ -37,6 +37,7 @@ bool updatePaletteLinkColors() Application::Application(int& argc, char** argv) : QApplication(argc, argv) + , _local_tz(QTimeZone::systemTimeZone()) , _pm(this) { updatePaletteLinkColors(); @@ -356,6 +357,18 @@ void Application::onTimer() auto now = QDateTime::currentDateTime(); for (const auto& w : _windows) w->clock()->setDateTime(now); + + // there is no "time zone changed" event, + // so, track local time zone changes manually + if (now.timeZone() == _local_tz) + return; + + _local_tz = now.timeZone(); + + for (size_t i = 0; i < _windows.size(); i++) { + if (_cfg->window(i).generic().getShowLocalTime()) + _windows[i]->clock()->setTimeZone(_local_tz); + } } void Application::showSettingsDialog() diff --git a/app/core/application.hpp b/app/core/application.hpp index 2fac0b6..aa11b77 100644 --- a/app/core/application.hpp +++ b/app/core/application.hpp @@ -100,6 +100,7 @@ private slots: std::vector> _windows; QTimer _time_timer; QTimer _tick_timer; + QTimeZone _local_tz; SkinManager _sm; PluginManager _pm; DialogManager _dm;