forked from M-Labs/artiq
moninj: elide long widget titles
This commit is contained in:
parent
26b5618a2f
commit
3df13eb1c6
|
@ -40,8 +40,12 @@ class _MoninjWidget(QtWidgets.QFrame):
|
|||
self.grid.setHorizontalSpacing(0)
|
||||
self.grid.setVerticalSpacing(0)
|
||||
self.setLayout(self.grid)
|
||||
tooltip = title
|
||||
if len(title) > 20:
|
||||
title = title[:11] + "..." + title[-6:]
|
||||
label = QtWidgets.QLabel(title)
|
||||
label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
|
||||
label.setToolTip(tooltip)
|
||||
self.grid.addWidget(label, 1, 1)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue