Skip to content

Commit 1b763c1

Browse files
committed
qtdragon/hd -reset statusbar color after ten seconds
thanks Markopolo
1 parent b9540e7 commit 1b763c1

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

share/qtvcp/screens/qtdragon/qtdragon_handler.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def __init__(self, halcomp, widgets, paths):
9797
"btn_home_z", "action_home_a", "btn_reload_file", "macrobutton0", "macrobutton1",
9898
"macrobutton2", "macrobutton3", "macrobutton4", "macrobutton5", "macrobutton6",
9999
"macrobutton7", "macrobutton8", "macrobutton9"]
100+
self.statusbar_reset_time = 10000 # ten seconds
100101

101102
STATUS.connect('general', self.dialog_return)
102103
STATUS.connect('state-on', lambda w: self.enable_onoff(True))
@@ -1139,13 +1140,20 @@ def forward(self):
11391140
def writer(self):
11401141
WRITER.show()
11411142

1143+
def endcolor(self):
1144+
self.timer = QtCore.QTimer()
1145+
self.timer.timeout.connect(self.set_style_default)
1146+
self.timer.start(self.statusbar_reset_time)
1147+
11421148
# change Status bar text color
11431149
def set_style_default(self):
11441150
self.w.lineEdit_statusbar.setStyleSheet("background-color: rgb(252, 252, 252);color: rgb(0,0,0)") #default white
11451151
def set_style_warning(self):
1146-
self.w.lineEdit_statusbar.setStyleSheet("background-color: rgb(242, 246, 103);color: rgb(0,0,0)") #yelow
1152+
self.w.lineEdit_statusbar.setStyleSheet("background-color: rgb(242, 246, 103);color: rgb(0,0,0)") #yellow
1153+
self.endcolor()
11471154
def set_style_critical(self):
11481155
self.w.lineEdit_statusbar.setStyleSheet("background-color: rgb(255, 144, 0);color: rgb(0,0,0)") #orange
1156+
self.endcolor()
11491157

11501158
def adjust_stacked_widgets(self,requestedIndex):
11511159
IGNORE = -1

share/qtvcp/screens/qtdragon_hd/qtdragon_hd_handler.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def __init__(self, halcomp, widgets, paths):
9898
self.axis_a_list = ["label_axis_a", "dro_axis_a", "action_zero_a", "axistoolbutton_a",
9999
"dro_button_stack_a", "widget_jog_angular", "widget_increments_angular",
100100
"a_plus_jogbutton", "a_minus_jogbutton"]
101+
self.statusbar_reset_time = 10000 # ten seconds
101102

102103
STATUS.connect('general', self.dialog_return)
103104
STATUS.connect('state-on', lambda w: self.enable_onoff(True))
@@ -1197,16 +1198,23 @@ def forward(self):
11971198
def writer(self):
11981199
WRITER.show()
11991200

1201+
def endcolor(self):
1202+
self.timer = QtCore.QTimer()
1203+
self.timer.timeout.connect(self.set_style_default)
1204+
self.timer.start(self.statusbar_reset_time)
1205+
12001206
# change Status bar text color
12011207
def set_style_default(self):
12021208
self.w.statusbar.setStyleSheet(
12031209
"background-color: rgb(252, 252, 252);color: rgb(0,0,0)") #default white
12041210
def set_style_warning(self):
12051211
self.w.statusbar.setStyleSheet(
1206-
"background-color: rgb(242, 246, 103);color: rgb(0,0,0)") #yelow
1212+
"background-color: rgb(242, 246, 103);color: rgb(0,0,0)") #yellow
1213+
self.endcolor()
12071214
def set_style_critical(self):
12081215
self.w.statusbar.setStyleSheet(
12091216
"background-color: rgb(255, 144, 0);color: rgb(0,0,0)") #orange
1217+
self.endcolor()
12101218

12111219
def adjust_stacked_widgets(self,requestedIndex):
12121220
IGNORE = -1

0 commit comments

Comments
 (0)