From e08068687ca80926e55b25d04eeb7b7bb1a01c36 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:49:16 +0000 Subject: [PATCH] fix: don't shrink window when setting minimum width --- src/qt/bitcoingui.cpp | 4 +++- src/qt/optionsdialog.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 9cdd8851dc..734360d53f 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1419,7 +1419,9 @@ void BitcoinGUI::updateWidth() // Use nButtonsVisible + 1 <- for the dash logo int nWidth = std::max(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) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 08da36cff8..2c83d165e2 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -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(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)