Skip to content

Commit

Permalink
Merge dashpay#6471: fix: don't shrink window when setting minimum width
Browse files Browse the repository at this point in the history
e080686 fix: don't shrink window when setting minimum width (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Closes dashpay#5886
  * We've been setting restrictions on the width of the window since [dash#3734](dashpay#3734) (see d351fca and c0447b0), meaning, the behavior as described in [dash#5886](dashpay#5886) has been present since v0.16 (v0.15 and earlier used the old UI design).
    * We do not set any restrictions on height and in that respect, Dash Qt will behave similar to Bitcoin Qt in that it can be resized to be arbitrarily small.

  ## How Has This Been Tested?

  Crossed compiled for `x86_64-w64-mingw32` and tested resulting `dash-qt.exe` on Windows 11 22H2 (Build 22621.431). Followed reproduction steps as mentioned in [dash#5886](dashpay#5886), found width to persist even after closing Options modal using buttons and the close button on the top right.

  ## Breaking Changes

  None expected.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    generally utACK e080686
  UdjinM6:
    utACK e080686

Tree-SHA512: ed3874c830c0ddf1a9e1166b75e3088969b7dfae8bca25af47045727e14a270ca2bb740e2c30b657b26a4b8e542dff8d898e5d5d2c9482d67da15578e0054632
  • Loading branch information
PastaPastaPasta committed Dec 10, 2024
2 parents 5329f04 + e080686 commit 8ec789f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ec789f

Please sign in to comment.