forked from M-Labs/artiq
gui/applets: use a better default size, make minimum size proportional to font
This commit is contained in:
parent
ddf6ec433e
commit
7cff4977b4
|
@ -89,7 +89,10 @@ class _AppletDock(QDockWidgetCloseDetect):
|
||||||
def __init__(self, datasets_sub, uid, name, command):
|
def __init__(self, datasets_sub, uid, name, command):
|
||||||
QDockWidgetCloseDetect.__init__(self, "Applet: " + name)
|
QDockWidgetCloseDetect.__init__(self, "Applet: " + name)
|
||||||
self.setObjectName("applet" + str(uid))
|
self.setObjectName("applet" + str(uid))
|
||||||
self.setMinimumSize(QtCore.QSize(100, 100))
|
|
||||||
|
qfm = QtGui.QFontMetrics(self.font())
|
||||||
|
self.setMinimumSize(20*qfm.averageCharWidth(), 5*qfm.lineSpacing())
|
||||||
|
self.resize(40*qfm.averageCharWidth(), 10*qfm.lineSpacing())
|
||||||
|
|
||||||
self.datasets_sub = datasets_sub
|
self.datasets_sub = datasets_sub
|
||||||
self.applet_name = name
|
self.applet_name = name
|
||||||
|
|
Loading…
Reference in New Issue