forked from M-Labs/artiq
gui: fix some dock sizing issues
This commit is contained in:
parent
c4b33bdf84
commit
0eb8079b45
|
@ -1,5 +1,6 @@
|
|||
import asyncio
|
||||
|
||||
from quamash import QtCore
|
||||
from pyqtgraph import console, dockarea
|
||||
|
||||
|
||||
|
@ -15,7 +16,8 @@ The following functions are available:
|
|||
|
||||
class ConsoleDock(dockarea.Dock):
|
||||
def __init__(self, dataset_sub, dataset_ctl):
|
||||
dockarea.Dock.__init__(self, "Console", size=(1000, 300))
|
||||
dockarea.Dock.__init__(self, "Console")
|
||||
self.setMinimumSize(QtCore.QSize(850, 300))
|
||||
self.dataset_sub = dataset_sub
|
||||
self.dataset_ctl = dataset_ctl
|
||||
ns = {
|
||||
|
|
|
@ -43,7 +43,7 @@ def _get_display_type_name(display_cls):
|
|||
|
||||
class DatasetsDock(dockarea.Dock):
|
||||
def __init__(self, dialog_parent, dock_area, datasets_sub):
|
||||
dockarea.Dock.__init__(self, "Datasets", size=(1500, 500))
|
||||
dockarea.Dock.__init__(self, "Datasets")
|
||||
self.dialog_parent = dialog_parent
|
||||
self.dock_area = dock_area
|
||||
|
||||
|
@ -128,7 +128,6 @@ class DatasetsDock(dockarea.Dock):
|
|||
def on_close():
|
||||
del self.displays[name]
|
||||
dsp.sigClosed.connect(on_close)
|
||||
self.dock_area.addDock(dsp)
|
||||
self.dock_area.floatDock(dsp)
|
||||
return dsp
|
||||
|
||||
|
|
|
@ -76,8 +76,7 @@ class NumberDisplaySettings(_SimpleSettings):
|
|||
|
||||
class NumberDisplay(dockarea.Dock):
|
||||
def __init__(self, name, settings):
|
||||
dockarea.Dock.__init__(self, "Display: " + name, size=(250, 250),
|
||||
closable=True)
|
||||
dockarea.Dock.__init__(self, "Display: " + name, closable=True)
|
||||
self.settings = settings
|
||||
self.number = QtGui.QLCDNumber()
|
||||
self.number.setDigitCount(10)
|
||||
|
@ -108,8 +107,7 @@ class XYDisplaySettings(_SimpleSettings):
|
|||
|
||||
class XYDisplay(dockarea.Dock):
|
||||
def __init__(self, name, settings):
|
||||
dockarea.Dock.__init__(self, "XY: " + name, size=(640, 480),
|
||||
closable=True)
|
||||
dockarea.Dock.__init__(self, "XY: " + name, closable=True)
|
||||
self.settings = settings
|
||||
self.plot = pg.PlotWidget()
|
||||
self.addWidget(self.plot)
|
||||
|
@ -175,8 +173,7 @@ class HistogramDisplaySettings(_SimpleSettings):
|
|||
|
||||
class HistogramDisplay(dockarea.Dock):
|
||||
def __init__(self, name, settings):
|
||||
dockarea.Dock.__init__(self, "Histogram: " + name, size=(640, 480),
|
||||
closable=True)
|
||||
dockarea.Dock.__init__(self, "Histogram: " + name, closable=True)
|
||||
self.settings = settings
|
||||
self.plot = pg.PlotWidget()
|
||||
self.addWidget(self.plot)
|
||||
|
|
|
@ -235,8 +235,8 @@ class _ArgumentEditor(QtGui.QTreeWidget):
|
|||
|
||||
class _ExperimentDock(dockarea.Dock):
|
||||
def __init__(self, manager, expurl):
|
||||
dockarea.Dock.__init__(self, "Exp: " + expurl,
|
||||
closable=True, size=(1500, 500))
|
||||
dockarea.Dock.__init__(self, "Exp: " + expurl, closable=True)
|
||||
self.setMinimumSize(QtCore.QSize(1100, 700))
|
||||
self.layout.setSpacing(5)
|
||||
self.layout.setContentsMargins(5, 5, 5, 5)
|
||||
|
||||
|
@ -487,7 +487,6 @@ class ExperimentManager:
|
|||
return self.open_experiments[expurl]
|
||||
dock = _ExperimentDock(self, expurl)
|
||||
self.open_experiments[expurl] = dock
|
||||
self.dock_area.addDock(dock)
|
||||
self.dock_area.floatDock(dock)
|
||||
dock.sigClosed.connect(partial(self.on_dock_closed, expurl))
|
||||
return dock
|
||||
|
|
|
@ -119,7 +119,8 @@ class Model(DictSyncTreeSepModel):
|
|||
class ExplorerDock(dockarea.Dock):
|
||||
def __init__(self, status_bar, exp_manager, d_shortcuts,
|
||||
explist_sub, schedule_ctl, experiment_db_ctl):
|
||||
dockarea.Dock.__init__(self, "Explorer", size=(1500, 500))
|
||||
dockarea.Dock.__init__(self, "Explorer")
|
||||
self.setMinimumSize(QtCore.QSize(300, 300))
|
||||
self.layout.setSpacing(5)
|
||||
self.layout.setContentsMargins(5, 5, 5, 5)
|
||||
|
||||
|
|
|
@ -143,7 +143,8 @@ class _LogFilterProxyModel(QSortFilterProxyModel):
|
|||
|
||||
class _LogDock(dockarea.Dock):
|
||||
def __init__(self, manager, name, log_sub):
|
||||
dockarea.Dock.__init__(self, name, label="Log", size=(1000, 300))
|
||||
dockarea.Dock.__init__(self, name, label="Log")
|
||||
self.setMinimumSize(QtCore.QSize(850, 450))
|
||||
|
||||
grid = LayoutWidget()
|
||||
self.addWidget(grid)
|
||||
|
@ -276,7 +277,6 @@ class LogDockManager:
|
|||
dock = _LogDock(self, name, self.log_sub)
|
||||
self.docks[name] = dock
|
||||
if add_to_area:
|
||||
self.dock_area.addDock(dock)
|
||||
self.dock_area.floatDock(dock)
|
||||
dock.sigClosed.connect(partial(self.on_dock_closed, name))
|
||||
self.update_closable()
|
||||
|
|
|
@ -215,7 +215,7 @@ class _DeviceManager:
|
|||
|
||||
class _MonInjDock(dockarea.Dock):
|
||||
def __init__(self, name):
|
||||
dockarea.Dock.__init__(self, name, size=(1500, 500))
|
||||
dockarea.Dock.__init__(self, name)
|
||||
|
||||
self.grid = QtGui.QGridLayout()
|
||||
gridw = QtGui.QWidget()
|
||||
|
|
|
@ -57,7 +57,8 @@ class Model(DictSyncModel):
|
|||
|
||||
class ScheduleDock(dockarea.Dock):
|
||||
def __init__(self, status_bar, schedule_ctl, schedule_sub):
|
||||
dockarea.Dock.__init__(self, "Schedule", size=(1000, 300))
|
||||
dockarea.Dock.__init__(self, "Schedule")
|
||||
self.setMinimumSize(QtCore.QSize(850, 300))
|
||||
|
||||
self.status_bar = status_bar
|
||||
self.schedule_ctl = schedule_ctl
|
||||
|
|
|
@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
class ShortcutsDock(dockarea.Dock):
|
||||
def __init__(self, main_window, exp_manager):
|
||||
dockarea.Dock.__init__(self, "Shortcuts", size=(1000, 300))
|
||||
dockarea.Dock.__init__(self, "Shortcuts")
|
||||
self.layout.setSpacing(5)
|
||||
self.layout.setContentsMargins(5, 5, 5, 5)
|
||||
|
||||
|
|
Loading…
Reference in New Issue