Revert "Remove minimum window size (#238)"

This reverts commit a2c2e06fd5.
This commit is contained in:
Eric Kotato 2021-12-27 01:37:30 +03:00
parent 9c3a3f65d6
commit 7de9e06e9f
2 changed files with 9 additions and 0 deletions

View file

@ -1398,6 +1398,7 @@ void Panel::initGeometry() {
const auto center = Core::App().getPointForCallPanelCenter();
const auto rect = QRect(0, 0, st::groupCallWidth, st::groupCallHeight);
window()->setGeometry(rect.translated(center - rect.center()));
window()->setMinimumSize(rect.size());
window()->show();
}

View file

@ -615,6 +615,8 @@ void MainWindow::refreshTitleWidget() {
}
void MainWindow::updateMinimumSize() {
setMinimumWidth(computeMinWidth());
setMinimumHeight(computeMinHeight());
}
void MainWindow::recountGeometryConstraints() {
@ -967,11 +969,17 @@ void MainWindow::showRightColumn(object_ptr<TWidget> widget) {
const auto wasMinimumWidth = minimumWidth();
const auto nowMinimumWidth = computeMinWidth();
const auto firstResize = (nowMinimumWidth < wasMinimumWidth);
if (firstResize) {
setMinimumWidth(nowMinimumWidth);
}
if (!isMaximized()) {
tryToExtendWidthBy(wasWidth + nowRightWidth - wasRightWidth - width());
} else {
updateControlsGeometry();
}
if (!firstResize) {
setMinimumWidth(nowMinimumWidth);
}
}
int MainWindow::maximalExtendBy() const {