Merge pull request #23471 from hyarion/change/tasks-at-right

This commit is contained in:
Max Wilfinger
2025-10-27 19:01:03 +01:00
committed by GitHub
2 changed files with 9 additions and 7 deletions

View File

@@ -757,7 +757,9 @@ void OverlayTabWidget::restore(ParameterGrp::handle handle)
}
if (!parentWidget())
return;
std::string widgets = handle->GetASCII("Widgets","");
std::string widgets = handle->GetASCII("Widgets", getDockArea() == Qt::RightDockWidgetArea ? "Tasks," : "");
for(auto &name : QString::fromUtf8(widgets.c_str()).split(QLatin1Char(','))) {
if(name.isEmpty())
continue;
@@ -766,14 +768,14 @@ void OverlayTabWidget::restore(ParameterGrp::handle handle)
if(dock)
addWidget(dock, dock->windowTitle());
}
int width = handle->GetInt("Width", 0);
int width = handle->GetInt("Width", getDockArea() == Qt::RightDockWidgetArea ? 400 : 0);
int height = handle->GetInt("Height", 0);
int offset1 = handle->GetInt("Offset1", 0);
int offset2 = handle->GetInt("Offset3", 0);
setOffset(QSize(offset1,offset2));
setSizeDelta(handle->GetInt("Offset2", 0));
if(width && height) {
QRect rect(0, 0, width, height);
if (width || height) {
QRect rect(0, 0, width > 0 ? width : this->width(), height > 0 ? height : this->height());
switch(dockArea) {
case Qt::RightDockWidgetArea:
rect.moveRight(parentWidget()->size().width());
@@ -792,12 +794,12 @@ void OverlayTabWidget::restore(ParameterGrp::handle handle)
setAutoMode(AutoMode::EditHide);
else if (handle->GetBool("EditShow", false))
setAutoMode(AutoMode::EditShow);
else if (handle->GetBool("TaskShow", false))
else if (handle->GetBool("TaskShow", getDockArea() == Qt::RightDockWidgetArea))
setAutoMode(AutoMode::TaskShow);
else
setAutoMode(AutoMode::NoAutoMode);
setTransparent(handle->GetBool("Transparent", false));
setTransparent(handle->GetBool("Transparent", getDockArea() == Qt::RightDockWidgetArea));
_sizemap.clear();
std::string savedSizes = handle->GetASCII("Sizes","");

View File

@@ -867,7 +867,7 @@ DockWindowItems* StdWorkbench::setupDockWindows() const
root->addDockWidget("Std_PropertyView", Qt::LeftDockWidgetArea, Gui::DockWindowOption::Visible);
root->addDockWidget("Std_SelectionView", Qt::LeftDockWidgetArea, Gui::DockWindowOption::Hidden);
root->addDockWidget("Std_ComboView", Qt::LeftDockWidgetArea, Gui::DockWindowOption::VisibleTabbed);
root->addDockWidget("Std_TaskView", Qt::LeftDockWidgetArea, Gui::DockWindowOption::VisibleTabbed);
root->addDockWidget("Std_TaskView", Qt::RightDockWidgetArea, Gui::DockWindowOption::VisibleTabbed);
root->addDockWidget("Std_ReportView", Qt::BottomDockWidgetArea, Gui::DockWindowOption::HiddenTabbed);
root->addDockWidget("Std_PythonView", Qt::BottomDockWidgetArea, Gui::DockWindowOption::HiddenTabbed);