Gui: implement WorkbenchSwitcher class to encapsulate the parameter details

This commit is contained in:
wmayer
2022-11-08 14:50:57 +01:00
committed by Uwe
parent e6a8533fa8
commit 3eaad09ed1
8 changed files with 147 additions and 21 deletions

View File

@@ -40,6 +40,7 @@
#include "Selection.h"
#include "ToolBarManager.h"
#include "ToolBoxManager.h"
#include "UserSettings.h"
#include "Window.h"
#include <App/Application.h>
@@ -751,9 +752,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const
<< "Std_Refresh" << "Separator" << "Std_WhatsThis";
// Workbench switcher
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow");
std::string defaultPos = "WSToolbar";
if (hGrp->GetASCII("WSPosition", defaultPos.c_str()) == defaultPos) {
if (WorkbenchSwitcher::isToolbar(WorkbenchSwitcher::getValue())) {
auto wb = new ToolBarItem(root);
wb->setCommand("Workbench");
*wb << "Std_Workbench";