修复无信号时时钟不刷新的问题

This commit is contained in:
2026-05-17 22:03:01 +08:00
parent 1c0fc59738
commit 854642af2c

View File

@@ -360,9 +360,9 @@ class MainWindow(QWidget):
self._wifi_label.setStyleSheet("color: #e86c60; font-size: 18px; font-weight: 600;")
# --- 时钟(有网络时更新;断网后保留最后一次的时间) ---
now = datetime.now()
self._clock_label.setText(now.strftime("%H:%M:%S"))
if is_connected:
now = datetime.now()
self._clock_label.setText(now.strftime("%H:%M:%S"))
if not self._clock_has_synced:
self._clock_has_synced = True
self._clock_label.show()