mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
Merge bitcoin-core/gui#116: Fix unreasonable default size of the main window without loaded wallets
7b2e42ecc4
qt: Add WalletFrame::sizeHint (Hennadii Stepanov) Pull request description: This PR fixes a bug in master (d67883d01e
) and in 0.20.1 that could be easily reproduced with ``` $ src/qt/bitcoin-qt -regtest -resetguisettings -nowallet ```   **With this PR:**   --- Fix #104 Fix #113 This PR is an alternative to #107 without [hard-coding a size in pixels](https://github.com/bitcoin-core/gui/pull/107#discussion_r511474021). ACKs for top commit: jonasschnelli: Tested ACK7b2e42ecc4
- I can confirm this fixes #104 (Ubuntu 20.04 - HiDPI 200%). Tree-SHA512: eb0692dbeb3befdeecca0e41534c9783eab6637c14cc4f170ee42619235884f9354f8d22a10c20c08cc89dc5340a60b7dfa2523c12e64b3386b3fd2c6d5f934e
This commit is contained in:
commit
55b1ffcd25
2 changed files with 13 additions and 7 deletions
|
@ -2,12 +2,13 @@
|
||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// 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/walletframe.h>
|
||||||
#include <qt/walletmodel.h>
|
|
||||||
|
|
||||||
#include <qt/bitcoingui.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 <qt/walletview.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -18,10 +19,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) :
|
WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
|
||||||
QFrame(_gui),
|
: QFrame(_gui),
|
||||||
gui(_gui),
|
gui(_gui),
|
||||||
platformStyle(_platformStyle)
|
platformStyle(_platformStyle),
|
||||||
|
m_size_hint(OverviewPage{platformStyle, nullptr}.sizeHint())
|
||||||
{
|
{
|
||||||
// Leave HBox hook for adding a list view later
|
// Leave HBox hook for adding a list view later
|
||||||
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
|
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
|
||||||
|
|
|
@ -45,6 +45,8 @@ public:
|
||||||
|
|
||||||
void showOutOfSyncWarning(bool fShow);
|
void showOutOfSyncWarning(bool fShow);
|
||||||
|
|
||||||
|
QSize sizeHint() const override { return m_size_hint; }
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
/** Notify that the user has requested more information about the out-of-sync warning */
|
/** Notify that the user has requested more information about the out-of-sync warning */
|
||||||
void requestedSyncWarningInfo();
|
void requestedSyncWarningInfo();
|
||||||
|
@ -59,6 +61,8 @@ private:
|
||||||
|
|
||||||
const PlatformStyle *platformStyle;
|
const PlatformStyle *platformStyle;
|
||||||
|
|
||||||
|
const QSize m_size_hint;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WalletView* currentWalletView() const;
|
WalletView* currentWalletView() const;
|
||||||
WalletModel* currentWalletModel() const;
|
WalletModel* currentWalletModel() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue