- the context menu for the Tabs in notebook and PlotTabArea is launched now on right mouse click on tabs themselves

This commit is contained in:
Marius Stanciu 2019-10-21 01:05:04 +03:00 committed by Marius
parent e1a7be88ce
commit 9b9f99d824
2 changed files with 28 additions and 9 deletions

View File

@ -1978,14 +1978,13 @@ class App(QtCore.QObject):
# ToolBar signals
self.connect_toolbar_signals()
# Notebook signals
# 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"])
# Notebook and Plot Tab Area signals
# make the right click on the notebook tab and plot tab area tab raise a menu
self.ui.notebook.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.ui.plot_tab_area.tabBar.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.on_tab_setup_context_menu()
# activate initial state
self.on_notebook_tab_rmb_click(self.defaults["global_tabs_detachable"])
self.on_tab_rmb_click(self.defaults["global_tabs_detachable"])
# Context Menu
self.ui.popmenu_disable.triggered.connect(lambda: self.toggle_plots(self.collection.get_selected()))
@ -6703,13 +6702,30 @@ class App(QtCore.QObject):
# This will write the setting to the platform specific storage.
del settings
def on_notebook_tab_rmb_click(self, checked):
def on_tab_rmb_click(self, checked):
self.ui.notebook.set_detachable(val=checked)
self.defaults["global_tabs_detachable"] = checked
self.ui.plot_tab_area.set_detachable(val=checked)
self.defaults["global_tabs_detachable"] = checked
def on_tab_setup_context_menu(self):
initial_checked = self.defaults["global_tabs_detachable"]
action_name = str(_("Detachable Tabs"))
action = QtWidgets.QAction(self)
action.setCheckable(True)
action.setText(action_name)
action.setChecked(initial_checked)
self.ui.notebook.tabBar.addAction(action)
self.ui.plot_tab_area.tabBar.addAction(action)
try:
action.triggered.disconnect()
except TypeError:
pass
action.triggered.connect(self.on_tab_rmb_click)
def on_deselect_all(self):
self.collection.set_all_inactive()
self.delete_selection_shape()

View File

@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
=================================================
21.10.2019
- the context menu for the Tabs in notebook and PlotTabArea is launched now on right mouse click on tabs themselves
18.10.2019
- fixed a small bug in BETA status change
@ -17,7 +21,6 @@ CAD program, and create G-Code for Isolation routing.
- started to work to a new tool: Calibrate Excellon Tool
- solved the issue #329
18.10.2019
- finished the update on the Google translated Spanish translation.