Gui: Restore previous width when closing task dialog

This fixes #11016
This commit is contained in:
wmayer
2024-05-18 15:59:54 +02:00
committed by Chris Hennes
parent cded7480bf
commit ae2b881477
3 changed files with 49 additions and 2 deletions

View File

@@ -599,9 +599,17 @@ bool MainWindow::setupTaskView()
{
// Task view
if (d->hiddenDockWindows.find("Std_TaskView") == std::string::npos) {
// clang-format off
auto group = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")
->GetGroup("Preferences")
->GetGroup("DockWindows")
->GetGroup("TaskView");
// clang-format on
auto taskView = new Gui::TaskView::TaskView(this);
taskView->setObjectName
(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tasks")));
bool restore = group->GetBool("RestoreWidth", taskView->shouldRestoreWidth());
taskView->setRestoreWidth(restore);
taskView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tasks")));
taskView->setMinimumWidth(210);
DockWindowManager* pDockMgr = DockWindowManager::instance();