Skip to content

Commit ff530a2

Browse files
committed
qt: Use GUIUtil::ThemedLabel class
This change fixes the GUI when changing appearance on macOS.
1 parent d99ef32 commit ff530a2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
150150
frameBlocksLayout->setContentsMargins(3,0,3,0);
151151
frameBlocksLayout->setSpacing(3);
152152
unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle);
153-
labelWalletEncryptionIcon = new QLabel();
154-
labelWalletHDStatusIcon = new QLabel();
153+
labelWalletEncryptionIcon = new GUIUtil::ThemedLabel(platformStyle);
154+
labelWalletHDStatusIcon = new GUIUtil::ThemedLabel(platformStyle);
155155
labelProxyIcon = new GUIUtil::ClickableLabel();
156156
connectionsControl = new GUIUtil::ClickableLabel();
157157
labelBlocksIcon = new GUIUtil::ClickableLabel();
@@ -1266,7 +1266,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
12661266

12671267
void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled)
12681268
{
1269-
labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(privkeyDisabled ? ":/icons/eye" : hdEnabled ? ":/icons/hd_enabled" : ":/icons/hd_disabled").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1269+
labelWalletHDStatusIcon->setThemedPixmap(privkeyDisabled ? QStringLiteral(":/icons/eye") : hdEnabled ? QStringLiteral(":/icons/hd_enabled") : QStringLiteral(":/icons/hd_disabled"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
12701270
labelWalletHDStatusIcon->setToolTip(privkeyDisabled ? tr("Private key <b>disabled</b>") : hdEnabled ? tr("HD key generation is <b>enabled</b>") : tr("HD key generation is <b>disabled</b>"));
12711271
labelWalletHDStatusIcon->show();
12721272
// eventually disable the QLabel to set its opacity to 50%
@@ -1285,15 +1285,15 @@ void BitcoinGUI::setEncryptionStatus(int status)
12851285
break;
12861286
case WalletModel::Unlocked:
12871287
labelWalletEncryptionIcon->show();
1288-
labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1288+
labelWalletEncryptionIcon->setThemedPixmap(QStringLiteral(":/icons/lock_open"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
12891289
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
12901290
encryptWalletAction->setChecked(true);
12911291
changePassphraseAction->setEnabled(true);
12921292
encryptWalletAction->setEnabled(false);
12931293
break;
12941294
case WalletModel::Locked:
12951295
labelWalletEncryptionIcon->show();
1296-
labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
1296+
labelWalletEncryptionIcon->setThemedPixmap(QStringLiteral(":/icons/lock_closed"), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
12971297
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
12981298
encryptWalletAction->setChecked(true);
12991299
changePassphraseAction->setEnabled(true);

src/qt/bitcoingui.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <config/bitcoin-config.h>
1010
#endif
1111

12+
#include <qt/guiutil.h>
1213
#include <qt/optionsdialog.h>
1314

1415
#include <amount.h>
@@ -121,8 +122,8 @@ class BitcoinGUI : public QMainWindow
121122
WalletFrame* walletFrame = nullptr;
122123

123124
UnitDisplayStatusBarControl* unitDisplayControl = nullptr;
124-
QLabel* labelWalletEncryptionIcon = nullptr;
125-
QLabel* labelWalletHDStatusIcon = nullptr;
125+
GUIUtil::ThemedLabel* labelWalletEncryptionIcon = nullptr;
126+
GUIUtil::ThemedLabel* labelWalletHDStatusIcon = nullptr;
126127
GUIUtil::ClickableLabel* labelProxyIcon = nullptr;
127128
GUIUtil::ClickableLabel* connectionsControl = nullptr;
128129
GUIUtil::ClickableLabel* labelBlocksIcon = nullptr;

0 commit comments

Comments
 (0)