From b6260615a6aa1b765dd9373c8c3ca68c1b139ed7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 1 Dec 2015 22:51:15 +0800 Subject: [PATCH] gui/log: better-looking new dock feature --- artiq/gui/log.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/artiq/gui/log.py b/artiq/gui/log.py index d7b5a000e..f3f1a1fe6 100644 --- a/artiq/gui/log.py +++ b/artiq/gui/log.py @@ -161,6 +161,15 @@ class _LogDock(dockarea.Dock): self.filter_freetext_changed) grid.addWidget(self.filter_freetext, 0, 2) + newdock = QtGui.QToolButton() + newdock.setToolTip("Create new log dock") + newdock.setIcon(QtGui.QApplication.style().standardIcon( + QtGui.QStyle.SP_FileDialogNewFolder)) + # note the lambda, the default parameter is overriden otherwise + newdock.clicked.connect(lambda: manager.create_new_dock()) + grid.addWidget(newdock, 0, 3) + grid.layout.setColumnStretch(2, 1) + self.log = QtGui.QTableView() self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.log.horizontalHeader().setResizeMode( @@ -179,12 +188,6 @@ class _LogDock(dockarea.Dock): self.scroll_at_bottom = False self.scroll_value = 0 - self.log.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - newlog_action = QtGui.QAction("Create new log dock", self.log) - # note the lambda, the default parameter is overriden otherwise - newlog_action.triggered.connect(lambda: manager.create_new_dock()) - self.log.addAction(newlog_action) - log_sub.add_setmodel_callback(self.set_model) def filter_level_changed(self):