0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-04 13:55:23 -05:00

qt: Add WalletFrame::sizeHint

This change makes the layout of a WalletFrame widget correct even
without loaded wallets.
This commit is contained in:
Hennadii Stepanov 2020-10-25 21:12:58 +02:00
parent d67883d01e
commit 7b2e42ecc4
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 13 additions and 7 deletions

View file

@ -2,12 +2,13 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/createwalletdialog.h>
#include <qt/walletcontroller.h>
#include <qt/walletframe.h>
#include <qt/walletmodel.h>
#include <qt/bitcoingui.h>
#include <qt/createwalletdialog.h>
#include <qt/overviewpage.h>
#include <qt/walletcontroller.h>
#include <qt/walletmodel.h>
#include <qt/walletview.h>
#include <cassert>
@ -18,10 +19,11 @@
#include <QPushButton>
#include <QVBoxLayout>
WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) :
QFrame(_gui),
gui(_gui),
platformStyle(_platformStyle)
WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
: QFrame(_gui),
gui(_gui),
platformStyle(_platformStyle),
m_size_hint(OverviewPage{platformStyle, nullptr}.sizeHint())
{
// Leave HBox hook for adding a list view later
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);

View file

@ -45,6 +45,8 @@ public:
void showOutOfSyncWarning(bool fShow);
QSize sizeHint() const override { return m_size_hint; }
Q_SIGNALS:
/** Notify that the user has requested more information about the out-of-sync warning */
void requestedSyncWarningInfo();
@ -59,6 +61,8 @@ private:
const PlatformStyle *platformStyle;
const QSize m_size_hint;
public:
WalletView* currentWalletView() const;
WalletModel* currentWalletModel() const;