From 0398716487ad0e2cac0dd23f921fdf06214eb5aa Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 28 Sep 2023 17:32:01 +0200 Subject: [PATCH] Gui: fixes #10807: By default keep the old tabulated layout of ComboView and TaskView --- src/Gui/DockWindowManager.cpp | 14 ++++++++++++++ src/Gui/MainWindow.cpp | 6 +++--- src/Gui/PreferencePages/DlgSettingsGeneral.cpp | 12 ++++++------ src/Gui/Workbench.cpp | 4 ++-- src/Mod/Start/Gui/Workbench.cpp | 1 + 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index 9a9f2292d6..c6cacf0e3e 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -380,6 +380,20 @@ void DockWindowManager::setup(DockWindowItems* items) } } + // Don't always tabify after switching the workbench + static bool tabify = false; + if (!tabify) { + // tabify dock widgets for which "tabbed" is true and which have the same position + for (int i=0; i<4; i++) { + const QList& dws = areas[i]; + for (QList::ConstIterator it = dws.begin(); it != dws.end(); ++it) { + if (*it != dws.front()) { + getMainWindow()->tabifyDockWidget(dws.front(), *it); + tabify = true; + } + } + } + } } void DockWindowManager::saveState() diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index a162e7e645..a99dadab81 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -492,7 +492,7 @@ bool MainWindow::setupTreeView(const std::string& hiddenDockWindows) bool enabled = group->GetBool("Enabled", true); if (enabled != group->GetBool("Enabled", false)) { enabled = App::GetApplication().GetUserParameter().GetGroup("BaseApp") - ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_TreeView", true); + ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_TreeView", false); } group->SetBool("Enabled", enabled); //ensure entry exists. if (enabled) { @@ -537,7 +537,7 @@ bool MainWindow::setupPropertyView(const std::string& hiddenDockWindows) bool enabled = group->GetBool("Enabled", true); if (enabled != group->GetBool("Enabled", false)) { enabled = App::GetApplication().GetUserParameter().GetGroup("BaseApp") - ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_PropertyView", true); + ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_PropertyView", false); } group->SetBool("Enabled", enabled); //ensure entry exists. if (enabled) { @@ -578,7 +578,7 @@ bool MainWindow::setupComboView(const std::string& hiddenDockWindows) if (hiddenDockWindows.find("Std_ComboView") == std::string::npos) { ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DockWindows")->GetGroup("ComboView"); - bool enable = group->GetBool("Enabled", false); + bool enable = group->GetBool("Enabled", true); if (enable) { auto pcComboView = new ComboView(nullptr, this); diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp index cad62f17ff..40448509de 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp @@ -401,9 +401,9 @@ void DlgSettingsGeneral::changeEvent(QEvent *event) void DlgSettingsGeneral::saveDockWindowVisibility() { auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DockWindows"); - bool treeView = hGrp->GetGroup("TreeView")->GetBool("Enabled", true); - bool propertyView = hGrp->GetGroup("PropertyView")->GetBool("Enabled", true); - bool comboView = hGrp->GetGroup("ComboView")->GetBool("Enabled", false); + bool treeView = hGrp->GetGroup("TreeView")->GetBool("Enabled", false); + bool propertyView = hGrp->GetGroup("PropertyView")->GetBool("Enabled", false); + bool comboView = hGrp->GetGroup("ComboView")->GetBool("Enabled", true); switch (ui->treeMode->currentIndex()) { case 0: comboView = true; @@ -427,9 +427,9 @@ void DlgSettingsGeneral::loadDockWindowVisibility() ui->treeMode->addItem(tr("TreeView and PropertyView")); auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DockWindows"); - bool propertyView = hGrp->GetGroup("PropertyView")->GetBool("Enabled", true); - bool treeView = hGrp->GetGroup("TreeView")->GetBool("Enabled", true); - bool comboView = hGrp->GetGroup("ComboView")->GetBool("Enabled", false); + bool propertyView = hGrp->GetGroup("PropertyView")->GetBool("Enabled", false); + bool treeView = hGrp->GetGroup("TreeView")->GetBool("Enabled", false); + bool comboView = hGrp->GetGroup("ComboView")->GetBool("Enabled", true); int index = -1; if (propertyView || treeView) { index = 1; diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 01a4ebeb15..f195a88901 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -838,9 +838,9 @@ DockWindowItems* StdWorkbench::setupDockWindows() const //root->addDockWidget("Std_HelpView", Qt::RightDockWidgetArea, true, false); root->addDockWidget("Std_TreeView", Qt::LeftDockWidgetArea, true, false); root->addDockWidget("Std_PropertyView", Qt::LeftDockWidgetArea, true, false); - root->addDockWidget("Std_TaskView", Qt::LeftDockWidgetArea, true, true); root->addDockWidget("Std_SelectionView", Qt::LeftDockWidgetArea, false, false); - root->addDockWidget("Std_ComboView", Qt::LeftDockWidgetArea, false, false); + root->addDockWidget("Std_ComboView", Qt::LeftDockWidgetArea, true, true); + root->addDockWidget("Std_TaskView", Qt::LeftDockWidgetArea, true, true); root->addDockWidget("Std_ReportView", Qt::BottomDockWidgetArea, true, true); root->addDockWidget("Std_PythonView", Qt::BottomDockWidgetArea, true, true); diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index 667e6bde7f..8443a266ce 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -161,5 +161,6 @@ Gui::DockWindowItems* StartGui::Workbench::setupDockWindows() const Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows(); root->setVisibility(false); // hide all dock windows by default root->setVisibility("Std_ComboView", true); // except of the combo view + root->setVisibility("Std_TaskView", true); // and the task view return root; }