mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
qt: Stop the effect of hidden widgets on the size of QStackedWidget
Layouts of the hidden widgets, those are children of QStackedWidget, could prevent to adjust the size of the parent widget in the WalletFrame widget.
This commit is contained in:
parent
f0d04795e2
commit
af58f5b12c
1 changed files with 16 additions and 1 deletions
|
@ -106,9 +106,24 @@ void WalletFrame::setCurrentWallet(WalletModel* wallet_model)
|
|||
{
|
||||
if (mapWalletViews.count(wallet_model) == 0) return;
|
||||
|
||||
// Stop the effect of hidden widgets on the size hint of the shown one in QStackedWidget.
|
||||
WalletView* view_about_to_hide = currentWalletView();
|
||||
if (view_about_to_hide) {
|
||||
QSizePolicy sp = view_about_to_hide->sizePolicy();
|
||||
sp.setHorizontalPolicy(QSizePolicy::Ignored);
|
||||
view_about_to_hide->setSizePolicy(sp);
|
||||
}
|
||||
|
||||
WalletView *walletView = mapWalletViews.value(wallet_model);
|
||||
walletStack->setCurrentWidget(walletView);
|
||||
assert(walletView);
|
||||
|
||||
// Set or restore the default QSizePolicy which could be set to QSizePolicy::Ignored previously.
|
||||
QSizePolicy sp = walletView->sizePolicy();
|
||||
sp.setHorizontalPolicy(QSizePolicy::Preferred);
|
||||
walletView->setSizePolicy(sp);
|
||||
walletView->updateGeometry();
|
||||
|
||||
walletStack->setCurrentWidget(walletView);
|
||||
walletView->updateEncryptionStatus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue