From 4816d3fc76a66b03f0e5ec4e81999defa3be9488 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 16 Nov 2020 02:20:19 +0200 Subject: [PATCH] - made the Tool Tab closable --- CHANGELOG.md | 1 + appGUI/MainGUI.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f7d0ef1..fc46d5ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta - modified the behavior of the Tool Tab in the Notebook widget. Now the app start with the Tool Tab off. If an App Tool is launched then the Tool Tab is added and populated. If the same App Tool is launched again and the focus is in its Tool Tab then the Tool Tab is removed but if the focus is elsewhere then the focus is set again on the Tool Tab. - fixed the App Tools buttons in the Tools section of the Properties Tab for Excellon, Gerber and Geometry objects +- made the Tool Tab closable 15.11.2020 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 1e35ef33..1acae224 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -892,8 +892,8 @@ class MainGUI(QtWidgets.QMainWindow): self.setCentralWidget(self.splitter) # self.notebook = QtWidgets.QTabWidget() - self.notebook = FCDetachableTab(protect=True, parent=self) - self.notebook.setTabsClosable(False) + self.notebook = FCDetachableTab(protect=True, protect_by_name=[_("Project"), _("Properties")], parent=self) + # self.notebook.setTabsClosable(False) self.notebook.useOldIndex(True) self.splitter.addWidget(self.notebook) @@ -1350,6 +1350,7 @@ class MainGUI(QtWidgets.QMainWindow): self.project_tab_layout = QtWidgets.QVBoxLayout(self.project_frame) self.project_tab_layout.setContentsMargins(2, 2, 2, 2) self.notebook.addTab(self.project_tab, _("Project")) + self.notebook.protectTab(0) self.project_frame.setDisabled(False) # ######################################################################## @@ -1365,6 +1366,7 @@ class MainGUI(QtWidgets.QMainWindow): # self.properties_scroll_area.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) self.properties_tab_layout.addWidget(self.properties_scroll_area) self.notebook.addTab(self.properties_tab, _("Properties")) + self.notebook.protectTab(1) # ######################################################################## # ########################## TOOL Tab # ##################################