Skip to content

Commit d6d1e97

Browse files
hebastoPiRK
authored andcommitted
qt: Add WalletFrame::sizeHint
Summary: This change makes the layout of a WalletFrame widget correct even without loaded wallets. Previously, the window was very small, and as a result the progress dialog overlay was invisible. This is a backport of [[bitcoin-core/gui#116 | core-gui#116]] Test Plan: `src/qt/bitcoin-qt -regtest -resetguisettings -nowallet` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10680
1 parent 81fa8f1 commit d6d1e97

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/qt/walletframe.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <qt/createwalletdialog.h>
6-
#include <qt/walletcontroller.h>
75
#include <qt/walletframe.h>
86

97
#include <qt/bitcoingui.h>
8+
#include <qt/createwalletdialog.h>
9+
#include <qt/overviewpage.h>
10+
#include <qt/walletcontroller.h>
1011
#include <qt/walletmodel.h>
1112
#include <qt/walletview.h>
1213

@@ -19,7 +20,8 @@
1920
#include <cassert>
2021

2122
WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui)
22-
: QFrame(_gui), gui(_gui), platformStyle(_platformStyle) {
23+
: QFrame(_gui), gui(_gui), platformStyle(_platformStyle),
24+
m_size_hint(OverviewPage{platformStyle, nullptr}.sizeHint()) {
2325
// Leave HBox hook for adding a list view later
2426
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
2527
setContentsMargins(0, 0, 0, 0);

src/qt/walletframe.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class WalletFrame : public QFrame {
4545

4646
void showOutOfSyncWarning(bool fShow);
4747

48+
QSize sizeHint() const override { return m_size_hint; }
49+
4850
Q_SIGNALS:
4951
/** Notify that the user has requested more information about the
5052
* out-of-sync warning */
@@ -60,6 +62,8 @@ class WalletFrame : public QFrame {
6062

6163
const PlatformStyle *platformStyle;
6264

65+
const QSize m_size_hint;
66+
6367
public:
6468
WalletView *currentWalletView() const;
6569
WalletModel *currentWalletModel() const;

0 commit comments

Comments
 (0)