diff --git a/src/Gui/Dialogs/DlgPreferencesImp.cpp b/src/Gui/Dialogs/DlgPreferencesImp.cpp index d451d534e1..d5b539994e 100644 --- a/src/Gui/Dialogs/DlgPreferencesImp.cpp +++ b/src/Gui/Dialogs/DlgPreferencesImp.cpp @@ -365,18 +365,9 @@ int DlgPreferencesImp::minimumDialogWidth(int pageWidth) const { // this is additional safety spacing to ensure that everything fits with scrollbar etc. const auto additionalMargin = style()->pixelMetric(QStyle::PM_ScrollBarExtent) + 8; - - QSize size = ui->groupWidgetStack->sizeHint(); - int diff = pageWidth - size.width(); - int dw = width(); - - if (diff > 0) { - const int offset = 2; - dw += diff + offset; - } - - return dw + additionalMargin; + QSize tree = ui->groupsTreeView->sizeHint(); + return pageWidth + tree.width() + additionalMargin; } void DlgPreferencesImp::updatePageDependentWidgets() @@ -908,7 +899,7 @@ void DlgPreferencesImp::onStackWidgetChange(int index) ui->groupsTreeView->expand(parentItem->index()); parentItem->setExpanded(wasExpanded); } - + ui->groupsTreeView->selectionModel()->select(currentIndex, QItemSelectionModel::ClearAndSelect); }