fix: don't shrink window when setting minimum width

This commit is contained in:
Kittywhiskers Van Gogh 2024-12-09 11:49:16 +00:00
parent 7c00c868d8
commit e08068687c
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
2 changed files with 6 additions and 2 deletions

View File

@ -1419,7 +1419,9 @@ void BitcoinGUI::updateWidth()
// Use nButtonsVisible + 1 <- for the dash logo
int nWidth = std::max<int>(980, (nWidthWidestButton + 30) * (nButtonsVisible + 1));
setMinimumWidth(nWidth);
resize(nWidth, height());
// Resize to new minimum width but don't shrink window
resize(std::max(width(), nWidth), height());
}
void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header, SynchronizationState sync_state)

View File

@ -544,7 +544,9 @@ void OptionsDialog::updateWidth()
// Add 10 per button as padding and use minimum 585 which is what we used in css before
int nWidth = std::max<int>(585, (nWidthWidestButton + 10) * nButtonsVisible);
setMinimumWidth(nWidth);
resize(nWidth, height());
// Resize to new minimum width but don't shrink window
resize(std::max(width(), nWidth), height());
}
void OptionsDialog::showEvent(QShowEvent* event)