This repository was archived by the owner on Aug 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 99
1010__author__ = "robertbasic"
1111
12+ from PyQt5 .QtGui import QPainter , QColor , QPixmap
1213from PyQt5 .QtWidgets import QLabel , QWidget , QHBoxLayout
1314
1415
@@ -17,20 +18,33 @@ class PugdebugStatusBar(QWidget):
1718 def __init__ (self ):
1819 super (PugdebugStatusBar , self ).__init__ ()
1920 self .label = QLabel (self )
21+ self .light = QLabel (self )
2022
2123 layout = QHBoxLayout ()
24+ layout .addWidget (self .light )
2225 layout .addWidget (self .label )
2326
2427 self .setLayout (layout )
2528
2629 def set_debugging_status (self , status ):
2730 if status == 0 :
2831 text = "Idle ..."
32+ color = "gray"
2933 elif status == 1 :
3034 text = 'Waiting for connection ...'
35+ color = "orange"
3136 elif status == 2 :
3237 text = 'Debugging stopped ...'
38+ color = "red"
3339 elif status == 3 :
3440 text = 'Debugging in progress ...'
41+ color = "green"
3542
3643 self .label .setText (text )
44+
45+ self .pixmap = QPixmap (10 , 10 )
46+ color = QColor (color )
47+ self .pixmap .fill (color )
48+ painter = QPainter (self .pixmap )
49+ painter .drawRect (0 , 0 , 10 , 10 )
50+ self .light .setPixmap (self .pixmap )
You can’t perform that action at this time.
0 commit comments