More main window cleanup
@@ -54,6 +54,7 @@ class _QtMainWindow(QMainWindow):
self.setUnifiedTitleAndToolBarOnMac(True)
center = QWidget(self)
center.setLayout(QHBoxLayout())
+ center.layout().setContentsMargins(4, 0, 4, 0)
self.setCentralWidget(center)
def closeEvent(self, event):
@@ -104,10 +105,10 @@ class Window:
_ = get_app()
# Connect the Viewer and create the Main Window
- self.qt_viewer = QtViewer(viewer)
self._qt_window = _QtMainWindow()
+ self.qt_viewer = QtViewer(viewer)
+ self._qt_window.centralWidget().layout().addWidget(self.qt_viewer)
self._qt_window.setWindowTitle(self.qt_viewer.viewer.title)
- self._qt_center = self._qt_window.centralWidget()
self._status_bar = self._qt_window.statusBar()
# Dictionary holding dock widgets
@@ -131,9 +132,6 @@ class Window:
self._help = QLabel('')
self._status_bar.addPermanentWidget(self._help)
- self._qt_center.layout().addWidget(self.qt_viewer)
- self._qt_center.layout().setContentsMargins(4, 0, 4, 0)
-
self._update_theme()
self._add_viewer_dock_widget(self.qt_viewer.dockConsole, tabify=False)
@@ -861,9 +859,6 @@ class Window:
**theme,
)
)
- self._qt_center.setStyleSheet(
- template('QWidget { background: {{ background }}; }', **theme)
- )
self._qt_window.setStyleSheet(template(self.raw_stylesheet, **theme))
def _status_changed(self, event):
