Skip to content

Commit 7b2e42e

Browse files
committed
qt: Add WalletFrame::sizeHint
This change makes the layout of a WalletFrame widget correct even without loaded wallets.
1 parent d67883d commit 7b2e42e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/qt/walletframe.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
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>
8-
#include <qt/walletmodel.h>
96

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

1314
#include <cassert>
@@ -18,10 +19,11 @@
1819
#include <QPushButton>
1920
#include <QVBoxLayout>
2021

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

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 out-of-sync warning */
5052
void requestedSyncWarningInfo();
@@ -59,6 +61,8 @@ class WalletFrame : public QFrame
5961

6062
const PlatformStyle *platformStyle;
6163

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

0 commit comments

Comments
 (0)