mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-28 20:53:35 +08:00
browser: toolbar, rm mdiarea tooltip (closes #433)
This commit is contained in:
parent
07b80cc5ab
commit
5e094528c1
@ -348,7 +348,6 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||
self.pixmap = QtGui.QPixmap(os.path.join(
|
||||
artiq_dir, "gui", "logo20.svg"))
|
||||
self.current_dir = root
|
||||
self.setToolTip("Click to open experiment")
|
||||
|
||||
self.open_experiments = []
|
||||
|
||||
@ -364,7 +363,7 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||
|
||||
def mousePressEvent(self, ev):
|
||||
if ev.button() == QtCore.Qt.LeftButton:
|
||||
asyncio.ensure_future(self._select_experiment_task())
|
||||
self.select_experiment()
|
||||
|
||||
def paintEvent(self, event):
|
||||
QtWidgets.QMdiArea.paintEvent(self, event)
|
||||
@ -389,7 +388,7 @@ class ExperimentsArea(QtWidgets.QMdiArea):
|
||||
ex_state["arguments"])
|
||||
dock.restore_state(ex_state["dock"])
|
||||
|
||||
def _select_experiment(self):
|
||||
def select_experiment(self):
|
||||
asyncio.ensure_future(self._select_experiment_task())
|
||||
|
||||
async def _select_experiment_task(self):
|
||||
|
@ -81,6 +81,7 @@ def main():
|
||||
# initialize main window
|
||||
main_window = MainWindow()
|
||||
smgr.register(main_window)
|
||||
main_window.setUnifiedTitleAndToolBarOnMac(True)
|
||||
status_bar = QtWidgets.QStatusBar()
|
||||
main_window.setStatusBar(status_bar)
|
||||
|
||||
@ -105,6 +106,17 @@ def main():
|
||||
main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_applets)
|
||||
main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_datasets)
|
||||
|
||||
toolbar = main_window.addToolBar("Experiment")
|
||||
toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
|
||||
open_action = QtWidgets.QAction("Open Experiment", main_window)
|
||||
open_action.setIcon(app.style().standardIcon(
|
||||
QtWidgets.QStyle.SP_DialogOpenButton))
|
||||
open_action.setShortcuts(QtGui.QKeySequence.Open)
|
||||
open_action.setStatusTip("Open existing experiment from file")
|
||||
open_action.triggered.connect(mdi_area.select_experiment)
|
||||
toolbar.addAction(open_action)
|
||||
|
||||
# load/initialize state
|
||||
if os.name == "nt":
|
||||
# HACK: show the main window before creating applets.
|
||||
|
Loading…
Reference in New Issue
Block a user