forked from FreeCAD/FreeCAD
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sketcher/Gui: Extend toolbar framework and fFix toolbar visibility no…
…t preserved ================================================================================= fixes FreeCAD#9208 Essentially: - The regular mechanism to save toolbar state when changing from one WB to another is not designed to support changes within one WB (e.g. from edit mode and back). - At creation time, toolbars can be initialised with default visible or default hidden state. Additionally, there is third configuration "Unavailable", which refers to a toolbar that is hidden, and the control to enable it is also hidden by default. - The ToolBarManager is extended to enable to set the State of one or more toolbars. - The State refers to changes to be effected on one or more toolbars by client code: * ForceHidden allows to hide a toolbar and also hide its control (a toolbar not available in a mode). * ForceAvailable allows to make a toolbar available by making its control visible, the toolbar itself is visible or not depending on user settings. * RestoreDefault allows to bring the control visibility to the default of the toolbar, the toolbar itself is visible or not depending on user settings. * SaveState allows to store the current visibility state of a toolbar. It enables client code to save the state when appropriate. It provides the only option for default "Unavailable" toolbars, which are fully managed by client code. It provides additional flexibility to save other toolbar visibility on request. For the Sketcher this means: - That edit mode toolbars are not shown outside edit mode. - That edit mode toolbars and non-edit mode toolbars can be configured independently. - that edit mode toolbars' state is saved when leaving edit mode if and only if, the workbench that is selected when leaving edit mode is the Sketcher WB. - it won't save the state if the user manually selected another WB and then left edit mode (why? see limitation above). Limitation: - When switching to another WB while in edit mode, the other WB is activated before the current WB (sketcher WB) is deactivated. This means that at sketcher level, the sketcher has no chance to save states or do other tidy up actions before the tools of the other WB are activated. - This, however, is understood as not relevant enough as to warrant changing the mechanisms in place.
- Loading branch information
1 parent
4a90f6e
commit 53c2b3d
Showing
4 changed files
with
185 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters