* Gui: support toolbar drag and drop to status bar and menu bar
ClosesFreeCAD/FreeCAD#12979
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Gui: improve toolbar handling in status and menu bar
* Gui: fix workbench tab bar orientation in status or menu bar
* Gui: remove workbench toolbar position settings
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
+ replace three boolean parameters with a single string parameter
+ refactor DlgGeneralImp::saveSettings/loadSettings
+ handle visibility of corner widgets
Related #6097
Qt ignores shortcut of actions in invisible toolbar, but not for actions
in a hidden menu action of menu bar, which is likely a Qt bug. The
desired behavior should be that of toolbar actions, so that actions
belong to different workbenches can have the same shortcut without
conflict.
This commit works around this inconsistency by ensuring only the active
actions are added in menu bar. In addition, all active actions will be
added to a zero sized child widget of the main window, which ensures the
shortcuts of these actions being active regardless whether the action is
in toolbar or menu bar, visible or not.
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto.
* When possible use a ranged for loop instead of begin() and end() iterators
With Qt => 5.9, it would randomly crash when opening a menu after changing workbenches.
Evidently it is a Qt macOS bug related to removing actions from menus.
Recreating the menus everytime avoids the issue.