From b59283f85eeb956938116ee9261ef5ecb9c63d3e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 29 Mar 2016 17:10:37 +0800 Subject: [PATCH] gui/applets: use a better default size, make minimum size proportional to font --- artiq/gui/applets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/gui/applets.py b/artiq/gui/applets.py index 90b1f6c9a..d81e007db 100644 --- a/artiq/gui/applets.py +++ b/artiq/gui/applets.py @@ -89,7 +89,10 @@ class _AppletDock(QDockWidgetCloseDetect): def __init__(self, datasets_sub, uid, name, command): QDockWidgetCloseDetect.__init__(self, "Applet: " + name) 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.applet_name = name