- the notebook is automatically collapsed when there are no objects in the collection and it is showed when adding an object

- added new options in Edit -> Preferences -> General -> App Preferences to control if the Notebook is showed at startup and if the notebook is closed when there are no objects in the collection and showed when the collection has objects.
This commit is contained in:
Marius Stanciu
2019-02-15 01:48:34 +02:00
committed by Marius S
parent 098de7f030
commit a978b5621d
6 changed files with 66 additions and 18 deletions

View File

@@ -676,6 +676,11 @@ class ObjectCollection(QtCore.QAbstractItemModel):
if group.child_count() is 1:
self.view.setExpanded(group_index, True)
# decide if to show or hide the Notebook side of the screen
if self.app.defaults["global_project_autohide"] is True:
# always open the notebook on object added to collection
self.app.ui.splitter.setSizes([1, 1])
def get_names(self):
"""
Gets a list of the names of all objects in the collection.
@@ -768,6 +773,12 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# always go to the Project Tab after object deletion as it may be done with a shortcut key
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
# decide if to show or hide the Notebook side of the screen
if self.app.defaults["global_project_autohide"] is True:
# hide the notebook if there are no objects in the collection
if not self.get_list():
self.app.ui.splitter.setSizes([0, 1])
def delete_all(self):
FlatCAMApp.App.log.debug(str(inspect.stack()[1][3]) + "--> OC.delete_all()")