- in Geometry Editor and in the Gerber Editor made sure that for the sub-tools that open in the Tool Tab, if the tab is closed then the Select Tool is automatically selected. And also trying to open that sub-tool again will open a new tab.

This commit is contained in:
Marius Stanciu
2020-11-20 22:49:34 +02:00
committed by Marius
parent 2065e4c178
commit 5f39a7b634
4 changed files with 103 additions and 4 deletions

View File

@@ -2624,6 +2624,9 @@ class FCDetachableTab(QtWidgets.QTabWidget):
self.setTabsClosable(True)
self.tabCloseRequested.connect(self.closeTab)
# called when one of the tabs is closed
self.callback_on_close = lambda: None
def set_rmb_callback(self, callback):
"""
@@ -2685,7 +2688,7 @@ class FCDetachableTab(QtWidgets.QTabWidget):
:param currentIndex:
:return:
"""
self.callback_on_close()
self.removeTab(currentIndex)
def on_closetab_middle_button(self, current_index):
@@ -2697,6 +2700,7 @@ class FCDetachableTab(QtWidgets.QTabWidget):
# if tab is protected don't delete it
if self.tabBar.tabButton(current_index, QtWidgets.QTabBar.RightSide) is not None:
self.callback_on_close()
self.removeTab(current_index)
def protectTab(self, currentIndex):