From b3b0e19d21800c893bcb2c32253be1dcc94d1808 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 19 Jun 2016 08:50:38 +0800 Subject: [PATCH] dashboard: compute initial experiment window size from font metrics --- artiq/dashboard/experiments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/dashboard/experiments.py b/artiq/dashboard/experiments.py index e8ad88ebc..dbb3e65c6 100644 --- a/artiq/dashboard/experiments.py +++ b/artiq/dashboard/experiments.py @@ -200,7 +200,8 @@ class _ExperimentDock(QtWidgets.QMdiSubWindow): def __init__(self, manager, expurl): QtWidgets.QMdiSubWindow.__init__(self) - self.resize(800, 600) + qfm = QtGui.QFontMetrics(self.font()) + self.resize(90*qfm.averageCharWidth(), 30*qfm.lineSpacing()) self.setWindowTitle(expurl) self.setWindowIcon(QtWidgets.QApplication.style().standardIcon( QtWidgets.QStyle.SP_FileDialogContentsView))