Skip to content

Commit 230da9c

Browse files
committed
qtplasmac: fix power button styling
1 parent a317abc commit 230da9c

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac.style

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,24 @@ QPushButton:checked:pressed, QToolButton:checked:pressed {
182182
background: e-stop;
183183
border-color: e-stop }
184184

185+
/****** POWER BUTTON ************/
186+
#power,
187+
#power:checked:pressed {
188+
color: foregnd;
189+
background: backgnd;
190+
border-color: foregnd }
191+
192+
#power:disabled {
193+
color: inactive;
194+
background: backgnd;
195+
border-color: inactive }
196+
197+
#power:pressed,
198+
#power:checked {
199+
color: backgnd;
200+
background: foregnd;
201+
border-color: foregnd }
202+
185203
/****** ERROR LABEL ************/
186204
#error_label {
187205
color: e-stop;

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = '1.236.294'
1+
VERSION = '1.236.295'
22

33
'''
44
qtplasmac_handler.py
@@ -330,6 +330,9 @@ def __init__(self, halcomp, widgets, paths):
330330

331331
# called by qtvcp.py
332332
def initialized__(self):
333+
ucFile = os.path.join(self.PATHS.CONFIGPATH, 'qtplasmac_custom.py')
334+
if os.path.isfile(ucFile):
335+
exec(compile(open(ucFile, 'rb').read(), ucFile, 'exec'))
333336
# ensure we get all startup errors
334337
STATUS.connect('error', self.error_update)
335338
STATUS.connect('graphics-gcode-error', lambda o, e:self.error_update(o, linuxcnc.OPERATOR_ERROR, e))
@@ -1326,20 +1329,12 @@ def buttons_show(self, first, last):
13261329
def estop_state(self, state):
13271330
if state:
13281331
self.w.power.setChecked(False)
1329-
self.w.power.setStyleSheet(' \
1330-
QPushButton {{ color: {2}; background: {1}; border-color: {2} }} \
1331-
QPushButton:pressed {{ color: {2}; background: {1}; border-color: {0} }}' \
1332-
.format(self.foreColor, self.backColor, self.disabledColor))
1332+
self.w.power.setEnabled(False)
13331333
if not self.firstRun:
13341334
log = _translate('HandlerClass', 'Emergency stop pressed')
13351335
STATUS.emit('update-machine-log', log, 'TIME')
13361336
else:
1337-
self.w.power.setStyleSheet(' \
1338-
QPushButton {{ color: {0}; background: {1}; border-color: {0} }} \
1339-
QPushButton:pressed {{ color: {1}; background: {3}; border-color: {0} }} \
1340-
QPushButton:checked {{ color: {1}; background: {3}; border-color: {0} }} \
1341-
QPushButton:checked:pressed {{ color: {0}; background: {1}; border-color: {0} }}' \
1342-
.format(self.foreColor, self.backColor, self.disabledColor, self.fore1Color))
1337+
self.w.power.setEnabled(True)
13431338
if not self.firstRun:
13441339
log = _translate('HandlerClass', 'Emergency stop cleared')
13451340
STATUS.emit('update-machine-log', log, 'TIME')

share/qtvcp/screens/qtplasmac/versions.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ <h2>QtPlasmaC Version History</h2>
3030
</table>
3131
<br>
3232
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
33+
<br><b><u>v1.236.295 2023 Oct 21</u></b>
34+
<ul style="margin:0;">
35+
<li>fix power button styling</li>
36+
</ul>
37+
3338
<br><b><u>v1.236.294 2023 Oct 18</u></b>
3439
<ul style="margin:0;">
3540
<li>fix case switching in run from line</li>

0 commit comments

Comments
 (0)