Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sas/qtgui/MainWindow/GuiManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def addWidgets(self):
self.FileConverter = FileConverterWidget(self)
self.WhatsNew = WhatsNew(self._parent)

self.tabbedPlotWidget = TabbedPlotWidget(self)
self.tabbedPlotWidget = TabbedPlotWidget(self._parent)
self.tabbedPlotWidgetSubWindow = self._workspace.workspace.addSubWindow(self.tabbedPlotWidget)

def loadAllPerspectives(self):
""" Load all the perspectives"""
Expand Down
14 changes: 10 additions & 4 deletions src/sas/qtgui/Plotting/TabbedPlotWidget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from PySide6 import QtCore, QtGui, QtWidgets
from PySide6.QtGui import QCloseEvent

from sas.qtgui.Plotting.SubTabs import SubTabs
from sas.qtgui.Utilities import GuiUtils
Expand All @@ -9,7 +10,7 @@ class TabbedPlotWidget(QtWidgets.QTabWidget):
Central plot widget that holds tabs and subtabs for all existing plots
"""
def __init__(self, parent=None):
super(TabbedPlotWidget, self).__init__()
super(TabbedPlotWidget, self).__init__(parent)

# the manager/parent of this class is the GuiManager
self.manager = parent
Expand All @@ -25,7 +26,7 @@ def __init__(self, parent=None):
self.inv_tab_fitpage_dict = {}

self._set_icon()
self.setWindowTitle('TabbedPlotWidget')
self.setWindowTitle('PlotViewer')

self.setMinimumSize(500, 500)
self.hide()
Expand All @@ -50,7 +51,7 @@ def show_or_activate(self):

def add_tab_to_dict(self, tab_id: int) -> int:
"""
This method handles the bookkeeping for the existing tabs and there respective fitpages.
This method handles the bookkeeping for the existing tabs and their respective fitpages.
Only adds the tab_id to the dict, if it does not already exist in there.
Returns the tab index of the existing or newly added tab.
"""
Expand Down Expand Up @@ -102,4 +103,9 @@ def get_subtab_by_tab_id(self, tab_id: int):
else:
return None


def closeEvent(self, event: QCloseEvent):
"""
Overwrite the close event and minimize the window instead of closing it
"""
self.setWindowState(QtCore.Qt.WindowMinimized)
event.ignore()