Skip to content

Commit

Permalink
qt: Reset max width after it has been set to still allow window resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
xdustinface committed Sep 26, 2020
1 parent 62a6cbc commit 35dc39b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,10 @@ void BitcoinGUI::updateWidth()
int nWidth = std::max<int>(980, (nWidthWidestButton + 30) * (nButtonsVisible + 1));
setMinimumWidth(nWidth);
setMaximumWidth(nWidth);
// Reset the max width after it has been set to still allow window resizing
QTimer::singleShot(0, this, [=]() {
setMaximumWidth(std::numeric_limits<int>::max());
});
}

void BitcoinGUI::updateToolBarShortcuts()
Expand Down
4 changes: 4 additions & 0 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ void OptionsDialog::updateWidth()
int nWidth = std::max<int>(585, (nWidthWidestButton + 10) * nButtonsVisible);
setMinimumWidth(nWidth);
setMaximumWidth(nWidth);
// Reset the max width after it has been set to still allow window resizing
QTimer::singleShot(0, this, [=]() {
setMaximumWidth(std::numeric_limits<int>::max());
});
}

void OptionsDialog::showEvent(QShowEvent* event)
Expand Down

0 comments on commit 35dc39b

Please sign in to comment.