2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

gui/log: improve vertical scrolling

This commit is contained in:
Sebastien Bourdeauducq 2015-11-27 19:18:20 +08:00
parent 3c9b53b07b
commit 6671bb33a4

View File

@ -151,7 +151,7 @@ class _LogFilterProxyModel(QSortFilterProxyModel):
self.invalidateFilter()
class LogDock(dockarea.Dock):
class _LogDock(dockarea.Dock):
def __init__(self, manager, name, log_sub):
dockarea.Dock.__init__(self, name, label="Log", size=(1000, 300))
@ -181,6 +181,8 @@ class LogDock(dockarea.Dock):
self.log.verticalHeader().hide()
self.log.setHorizontalScrollMode(
QtGui.QAbstractItemView.ScrollPerPixel)
self.log.setVerticalScrollMode(
QtGui.QAbstractItemView.ScrollPerPixel)
self.log.setShowGrid(False)
self.log.setTextElideMode(QtCore.Qt.ElideNone)
grid.addWidget(self.log, 1, 0, colspan=4)
@ -278,7 +280,7 @@ class LogDockManager:
n += 1
name = "log" + str(n)
dock = LogDock(self, name, self.log_sub)
dock = _LogDock(self, name, self.log_sub)
self.docks[name] = dock
if add_to_area:
self.dock_area.addDock(dock)
@ -303,7 +305,7 @@ class LogDockManager:
if self.docks:
raise NotImplementedError
for name, dock_state in state.items():
dock = LogDock(self, name, self.log_sub)
dock = _LogDock(self, name, self.log_sub)
dock.restore_state(dock_state)
self.dock_area.addDock(dock)
self.docks[name] = dock