@@ -232,7 +232,7 @@ def _reconnect(self) -> bool:
232232 self .worker .state_changed .connect (self ._on_measure_state )
233233 self .worker_thread .start ()
234234
235- self .status_conn . setText ( "● 已连接" )
235+ self ._set_connection_status ( " 已连接" , "#4caf50 " )
236236 self .status_profile .setText (f"profile: { self ._profile_name } " )
237237 return True
238238
@@ -307,7 +307,11 @@ def _build_ui(self) -> None:
307307
308308 # 状态栏
309309 connected = self ._controller is not None
310- self .status_conn = QLabel ("● 已连接" if connected else "○ 未连接" )
310+ self .status_conn = QLabel ()
311+ if connected :
312+ self ._set_connection_status ("已连接" , "#4caf50" )
313+ else :
314+ self ._set_connection_status ("未连接" , "#f44336" )
311315 self .status_profile = QLabel (f"profile: { self ._profile_name } " )
312316 self .status_attempt = QLabel ("第 0 次" )
313317 self .status_timer = QLabel ("--:--:--" )
@@ -317,6 +321,11 @@ def _build_ui(self) -> None:
317321 sb .addWidget (self .status_attempt )
318322 sb .addPermanentWidget (self .status_timer )
319323
324+ def _set_connection_status (self , text : str , color : str ) -> None :
325+ """设置状态栏连接状态,圆点按状态着色。"""
326+ self .status_conn .setText (f"● { text } " )
327+ self .status_conn .setStyleSheet (f"color: { color } ; font-weight: bold;" )
328+
320329 # --- 测量状态更新 ---
321330
322331 def _on_measure_state (self , state : dict ) -> None :
@@ -336,11 +345,11 @@ def _set_busy(self, busy: bool) -> None:
336345 if busy :
337346 self .hotkey_timer .stop ()
338347 self .editor_page .setEnabled (False )
339- self .status_conn . setText ( "● 凹图运行中" )
348+ self ._set_connection_status ( " 凹图运行中" , "#ff9800 " )
340349 else :
341350 self .hotkey_timer .start (16 )
342351 self .editor_page .setEnabled (True )
343- self .status_conn . setText ( "● 已连接" )
352+ self ._set_connection_status ( " 已连接" , "#4caf50 " )
344353
345354 def _poll_hotkeys (self ) -> None :
346355 if self ._busy or self ._editor is None :
0 commit comments