gui: better default layout

This commit is contained in:
Sebastien Bourdeauducq 2016-03-29 16:59:43 +08:00
parent ac0f62628d
commit ddf6ec433e
1 changed files with 11 additions and 9 deletions

View File

@ -37,9 +37,14 @@ def get_argparser():
class MainWindow(QtWidgets.QMainWindow): class MainWindow(QtWidgets.QMainWindow):
def __init__(self, server): def __init__(self, server):
QtWidgets.QMainWindow.__init__(self) QtWidgets.QMainWindow.__init__(self)
icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "logo.svg")) icon = QtGui.QIcon(os.path.join(artiq_dir, "gui", "logo.svg"))
self.setWindowIcon(icon) self.setWindowIcon(icon)
self.setWindowTitle("ARTIQ - {}".format(server)) self.setWindowTitle("ARTIQ - {}".format(server))
qfm = QtGui.QFontMetrics(self.font())
self.resize(140*qfm.averageCharWidth(), 38*qfm.lineSpacing())
self.exit_request = asyncio.Event() self.exit_request = asyncio.Event()
def closeEvent(self, *args): def closeEvent(self, *args):
@ -149,17 +154,14 @@ def main():
smgr.register(logmgr) smgr.register(logmgr)
# lay out docks # lay out docks
right_docks = [d_explorer, d_shortcuts]
if os.name != "nt": if os.name != "nt":
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_ttl_dds.dds_dock) right_docks += [d_ttl_dds.ttl_dock, d_ttl_dds.dds_dock]
main_window.tabifyDockWidget(d_ttl_dds.dds_dock, d_ttl_dds.ttl_dock) right_docks += [d_datasets, d_applets]
main_window.tabifyDockWidget(d_ttl_dds.ttl_dock, d_applets) main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, right_docks[0])
main_window.tabifyDockWidget(d_applets, d_datasets) for d1, d2 in zip(right_docks, right_docks[1:]):
else: main_window.tabifyDockWidget(d1, d2)
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_applets)
main_window.tabifyDockWidget(d_applets, d_datasets)
main_window.tabifyDockWidget(d_datasets, d_shortcuts)
main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_schedule) main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_schedule)
main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d_explorer)
# load/initialize state # load/initialize state
if os.name == "nt": if os.name == "nt":