- changed the status bar label to have an icon instead of text

- added a label in status bar that will toggle the Preferences tab
- made some changes such that that the label in status bar for toggling the Preferences Tab will be updated in various cases of closing the tab
This commit is contained in:
Marius Stanciu
2020-06-01 23:09:15 +03:00
committed by Marius
parent cb5a20fda6
commit 0f04eb1215
10 changed files with 63 additions and 5 deletions

View File

@@ -1027,6 +1027,7 @@ class App(QtCore.QObject):
# ###########################################################################################################
self.ui.hud_label.clicked.connect(self.plotcanvas.on_toggle_hud)
self.ui.axis_status_label.clicked.connect(self.plotcanvas.on_toggle_axis)
self.ui.pref_status_label.clicked.connect(self.on_toggle_preferences)
# ###########################################################################################################
# ####################################### VARIOUS SIGNALS ###################################################
@@ -5130,6 +5131,29 @@ class App(QtCore.QObject):
if self.defaults['global_selection_shape'] is True:
self.draw_selection_shape(curr_sel_obj)
def on_toggle_preferences(self):
pref_open = False
for idx in range(self.ui.plot_tab_area.count()):
if self.ui.plot_tab_area.tabText(idx) == _("Preferences"):
pref_open = True
if pref_open:
for idx in range(self.ui.plot_tab_area.count()):
if self.ui.plot_tab_area.tabText(idx) == _("Preferences"):
self.ui.plot_tab_area.removeTab(idx)
break
self.ui.pref_status_label.setStyleSheet("")
else:
self.on_preferences()
self.ui.pref_status_label.setStyleSheet("""
QLabel
{
color: black;
background-color: lightseagreen;
}
"""
)
def on_preferences(self):
"""
Adds the Preferences in a Tab in Plot Area