MCPcopy Create free account
hub / github.com/BasicProtein/AugmentCode-Free / StatusLabel

Class StatusLabel

gui_qt6/components.py:157–184  ·  view source on GitHub ↗

状态显示标签

Source from the content-addressed store, hash-verified

155
156
157class StatusLabel(QLabel):
158 """状态显示标签"""
159
160 def __init__(self, parent=None):
161 super().__init__(parent)
162 self.setFont(get_default_font(10))
163 self.setAlignment(Qt.AlignmentFlag.AlignCenter)
164 self.hide() # 默认隐藏
165
166 def show_status(self, message: str, status_type: str = "info"):
167 """显示状态信息"""
168 self.setText(message)
169
170 # 根据状态类型设置颜色
171 colors = {
172 "success": "#059669",
173 "error": "#dc2626",
174 "warning": "#d97706",
175 "info": "#0ea5e9"
176 }
177
178 color = colors.get(status_type, colors["info"])
179 self.setStyleSheet(f"color: {color};")
180 self.show()
181
182 def hide_status(self):
183 """隐藏状态信息"""
184 self.hide()
185
186
187class LanguageSelector(QWidget):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected