Skip to content

Commit

Permalink
Remove setMinimumHeight because dockLocationChanged is called afterwards
Browse files Browse the repository at this point in the history
Initially we'll also set a default dock value but as soon as the dock is added, it will be updated with the new dock location.
  • Loading branch information
MrStevns committed Jul 29, 2024
1 parent e81ef60 commit ed25a46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/src/toolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ void ToolBoxWidget::initUI()

QSettings settings(PENCIL2D, PENCIL2D);
restoreGeometry(settings.value("ToolBoxGeom").toByteArray());

ui->scrollArea->setMinimumHeight(getMinHeightForWidth(width()));
}

void ToolBoxWidget::updateUI()
Expand All @@ -191,7 +189,7 @@ int ToolBoxWidget::getMinHeightForWidth(int width)
if (mDockArea != Qt::LeftDockWidgetArea && mDockArea != Qt::RightDockWidgetArea) {
return ui->scrollAreaWidgetContents_2->layout()->heightForWidth(width);
}
return BaseDockWidget::getMinHeightForWidth(width);
return 1;
}

void ToolBoxWidget::onToolSetActive(ToolType toolType)
Expand Down
2 changes: 1 addition & 1 deletion app/src/toolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public slots:

Ui::ToolBoxWidget* ui = nullptr;

Qt::DockWidgetArea mDockArea;
Qt::DockWidgetArea mDockArea = Qt::DockWidgetArea::LeftDockWidgetArea;
};

#endif

0 comments on commit ed25a46

Please sign in to comment.