mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-26 03:38:25 +08:00
gui: add TTL override label
This commit is contained in:
parent
b2af0f6cc3
commit
276a1784ef
@ -41,9 +41,12 @@ class _TTLWidget(QtGui.QFrame):
|
|||||||
self._direction = QtGui.QLabel()
|
self._direction = QtGui.QLabel()
|
||||||
self._direction.setAlignment(QtCore.Qt.AlignCenter)
|
self._direction.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
grid.addWidget(self._direction, 2, 1)
|
grid.addWidget(self._direction, 2, 1)
|
||||||
|
self._override = QtGui.QLabel()
|
||||||
|
self._override.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
grid.addWidget(self._override, 3, 1)
|
||||||
self._value = QtGui.QLabel()
|
self._value = QtGui.QLabel()
|
||||||
self._value.setAlignment(QtCore.Qt.AlignCenter)
|
self._value.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
grid.addWidget(self._value, 3, 1, 6, 1)
|
grid.addWidget(self._value, 4, 1, 6, 1)
|
||||||
|
|
||||||
self._value.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
self._value.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||||
menu = QtGui.QActionGroup(self._value)
|
menu = QtGui.QActionGroup(self._value)
|
||||||
@ -83,8 +86,10 @@ class _TTLWidget(QtGui.QFrame):
|
|||||||
if override:
|
if override:
|
||||||
value_s = "<b>" + value_s + "</b>"
|
value_s = "<b>" + value_s + "</b>"
|
||||||
color = " color=\"red\""
|
color = " color=\"red\""
|
||||||
|
self._override.setText("<font size=\"1\" color=\"red\">OVERRIDE</font>")
|
||||||
else:
|
else:
|
||||||
color = ""
|
color = ""
|
||||||
|
self._override.setText("")
|
||||||
self._value.setText("<font size=\"9\"{}>{}</font>".format(
|
self._value.setText("<font size=\"9\"{}>{}</font>".format(
|
||||||
color, value_s))
|
color, value_s))
|
||||||
oe = oe or self.force_out
|
oe = oe or self.force_out
|
||||||
|
Loading…
Reference in New Issue
Block a user