From 62e48eb5450982576a30201f24048d124c3f3e31 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 22 Aug 2019 01:38:20 +0300 Subject: [PATCH] - added ability to turn ON/OFF the detachable capability of the tabs in Plot Tab Area through a context menu activated by right mouse button click on the Plot Tab Area header --- FlatCAMApp.py | 16 +++++++++++++++- README.md | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 8f9285da..736fca8b 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -1585,10 +1585,20 @@ class App(QtCore.QObject): # make the right click on the notebook tab connect to a function self.ui.notebook.setupContextMenu() self.ui.notebook.addContextMenu( - "Detachable Tabs", self.on_notebook_tab_rmb_click, initial_checked=self.defaults["global_tabs_detachable"]) + _("Detachable Tabs"), self.on_notebook_tab_rmb_click, + initial_checked=self.defaults["global_tabs_detachable"]) # activate initial state self.on_notebook_tab_rmb_click(self.defaults["global_tabs_detachable"]) + # Plot Tab Area signals + # make the right click on the plot area tab connect to a function + self.ui.plot_tab_area.setupContextMenu() + self.ui.plot_tab_area.addContextMenu( + _("Detachable Tabs"), self.on_plot_area_tab_rmb_click, + initial_checked=self.defaults["global_tabs_detachable"]) + # activate initial state + self.on_plot_area_tab_rmb_click(self.defaults["global_tabs_detachable"]) + # Context Menu self.ui.popmenu_disable.triggered.connect(lambda: self.toggle_plots(self.collection.get_selected())) self.ui.popmenu_panel_toggle.triggered.connect(self.on_toggle_notebook) @@ -4611,6 +4621,10 @@ class App(QtCore.QObject): self.ui.notebook.set_detachable(val=checked) self.defaults["global_tabs_detachable"] = checked + def on_plot_area_tab_rmb_click(self, checked): + self.ui.plot_tab_area.set_detachable(val=checked) + self.defaults["global_tabs_detachable"] = checked + def on_deselect_all(self): self.collection.set_all_inactive() self.delete_selection_shape() diff --git a/README.md b/README.md index 88de6423..df8ced74 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ CAD program, and create G-Code for Isolation routing. 22.08.2019 - added ability to turn ON/OFF the detachable capability of the tabs in Notebook through a context menu activated by right mouse button click on the Notebook header +- added ability to turn ON/OFF the detachable capability of the tabs in Plot Tab Area through a context menu activated by right mouse button click on the Plot Tab Area header + 21.08.2019