Skip to content

Commit 822a818

Browse files
jonasschnelliPastaPastaPasta
authored andcommitted
Merge bitcoin-core/gui#116: Fix unreasonable default size of the main window without loaded wallets
7b2e42e qt: Add WalletFrame::sizeHint (Hennadii Stepanov) Pull request description: This PR fixes a bug in master (d67883d) and in 0.20.1 that could be easily reproduced with ``` $ src/qt/bitcoin-qt -regtest -resetguisettings -nowallet ``` ![Screenshot from 2020-10-25 21-21-27](https://user-images.githubusercontent.com/32963518/97117179-b1800100-170a-11eb-87c9-3120d39b9455.png) ![Screenshot from 2020-10-25 21-23-32](https://user-images.githubusercontent.com/32963518/97117186-b644b500-170a-11eb-8b5d-234ff7205003.png) **With this PR:** ![Screenshot from 2020-10-25 21-20-35](https://user-images.githubusercontent.com/32963518/97117226-f441d900-170a-11eb-8d66-98b7718a2bb1.png) ![Screenshot from 2020-10-25 21-23-03](https://user-images.githubusercontent.com/32963518/97117232-f99f2380-170a-11eb-85ed-c7b5ece926b2.png) --- Fix dashpay#104 Fix dashpay#113 This PR is an alternative to dashpay#107 without [hard-coding a size in pixels](bitcoin-core/gui#107 (comment)). ACKs for top commit: jonasschnelli: Tested ACK 7b2e42e - I can confirm this fixes dashpay#104 (Ubuntu 20.04 - HiDPI 200%). Tree-SHA512: eb0692dbeb3befdeecca0e41534c9783eab6637c14cc4f170ee42619235884f9354f8d22a10c20c08cc89dc5340a60b7dfa2523c12e64b3386b3fd2c6d5f934e
1 parent d0a6284 commit 822a818

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/qt/walletframe.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
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>
119
#include <qt/governancelist.h>
1210
#include <qt/masternodelist.h>
11+
#include <qt/overviewpage.h>
12+
#include <qt/walletcontroller.h>
13+
#include <qt/walletmodel.h>
1314
#include <qt/walletview.h>
1415

1516
#include <cassert>
@@ -19,9 +20,10 @@
1920
#include <QPushButton>
2021
#include <QVBoxLayout>
2122

22-
WalletFrame::WalletFrame(BitcoinGUI* _gui) :
23-
QFrame(_gui),
24-
gui(_gui)
23+
WalletFrame::WalletFrame(BitcoinGUI* _gui)
24+
: QFrame(_gui),
25+
gui(_gui),
26+
m_size_hint(OverviewPage{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
@@ -47,6 +47,8 @@ class WalletFrame : public QFrame
4747

4848
void showOutOfSyncWarning(bool fShow);
4949

50+
QSize sizeHint() const override { return m_size_hint; }
51+
5052
Q_SIGNALS:
5153
/** Notify that the user has requested more information about the out-of-sync warning */
5254
void requestedSyncWarningInfo();
@@ -62,6 +64,8 @@ class WalletFrame : public QFrame
6264

6365
bool bOutOfSync;
6466

67+
const QSize m_size_hint;
68+
6569
public:
6670
WalletView* currentWalletView() const;
6771
WalletModel* currentWalletModel() const;

0 commit comments

Comments
 (0)