@@ -150,11 +150,11 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
150
150
frameBlocksLayout->setContentsMargins (3 ,0 ,3 ,0 );
151
151
frameBlocksLayout->setSpacing (3 );
152
152
unitDisplayControl = new UnitDisplayStatusBarControl (platformStyle);
153
- labelWalletEncryptionIcon = new QLabel ( );
154
- labelWalletHDStatusIcon = new QLabel ( );
155
- labelProxyIcon = new GUIUtil::ClickableLabel ();
156
- connectionsControl = new GUIUtil::ClickableLabel ();
157
- labelBlocksIcon = new GUIUtil::ClickableLabel ();
153
+ labelWalletEncryptionIcon = new GUIUtil::ThemedLabel (platformStyle );
154
+ labelWalletHDStatusIcon = new GUIUtil::ThemedLabel (platformStyle );
155
+ labelProxyIcon = new GUIUtil::ClickableLabel (platformStyle );
156
+ connectionsControl = new GUIUtil::ClickableLabel (platformStyle );
157
+ labelBlocksIcon = new GUIUtil::ClickableLabel (platformStyle );
158
158
if (enableWallet)
159
159
{
160
160
frameBlocksLayout->addStretch ();
@@ -925,7 +925,7 @@ void BitcoinGUI::updateNetworkState()
925
925
tooltip = QString (" <nobr>" ) + tooltip + QString (" </nobr>" );
926
926
connectionsControl->setToolTip (tooltip);
927
927
928
- connectionsControl->setPixmap (platformStyle-> SingleColorIcon ( icon). pixmap ( STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE) );
928
+ connectionsControl->setThemedPixmap ( icon, STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
929
929
}
930
930
931
931
void BitcoinGUI::setNumConnections (int count)
@@ -1021,7 +1021,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
1021
1021
// Set icon state: spinning if catching up, tick otherwise
1022
1022
if (secs < MAX_BLOCK_TIME_GAP) {
1023
1023
tooltip = tr (" Up to date" ) + QString (" .<br>" ) + tooltip;
1024
- labelBlocksIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/synced" ). pixmap ( STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE) );
1024
+ labelBlocksIcon->setThemedPixmap ( QStringLiteral (" :/icons/synced" ), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1025
1025
1026
1026
#ifdef ENABLE_WALLET
1027
1027
if (walletFrame)
@@ -1047,9 +1047,9 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
1047
1047
tooltip = tr (" Catching up…" ) + QString (" <br>" ) + tooltip;
1048
1048
if (count != prevBlocks)
1049
1049
{
1050
- labelBlocksIcon->setPixmap (platformStyle-> SingleColorIcon ( QString (
1051
- " :/animation/spinner-%1" ).arg (spinnerFrame, 3 , 10 , QChar (' 0' )))
1052
- . pixmap ( STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE) );
1050
+ labelBlocksIcon->setThemedPixmap (
1051
+ QString ( " :/animation/spinner-%1" ).arg (spinnerFrame, 3 , 10 , QChar (' 0' )),
1052
+ STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1053
1053
spinnerFrame = (spinnerFrame + 1 ) % SPINNER_FRAMES;
1054
1054
}
1055
1055
prevBlocks = count;
@@ -1138,7 +1138,17 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty
1138
1138
1139
1139
void BitcoinGUI::changeEvent (QEvent *e)
1140
1140
{
1141
+ #ifdef Q_OS_MACOS
1142
+ if (e->type () == QEvent::PaletteChange) {
1143
+ overviewAction->setIcon (platformStyle->SingleColorIcon (QStringLiteral (" :/icons/overview" )));
1144
+ sendCoinsAction->setIcon (platformStyle->SingleColorIcon (QStringLiteral (" :/icons/send" )));
1145
+ receiveCoinsAction->setIcon (platformStyle->SingleColorIcon (QStringLiteral (" :/icons/receiving_addresses" )));
1146
+ historyAction->setIcon (platformStyle->SingleColorIcon (QStringLiteral (" :/icons/history" )));
1147
+ }
1148
+ #endif
1149
+
1141
1150
QMainWindow::changeEvent (e);
1151
+
1142
1152
#ifndef Q_OS_MAC // Ignored on Mac
1143
1153
if (e->type () == QEvent::WindowStateChange)
1144
1154
{
@@ -1256,7 +1266,7 @@ bool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)
1256
1266
1257
1267
void BitcoinGUI::setHDStatus (bool privkeyDisabled, int hdEnabled)
1258
1268
{
1259
- 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);
1260
1270
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>" ));
1261
1271
labelWalletHDStatusIcon->show ();
1262
1272
// eventually disable the QLabel to set its opacity to 50%
@@ -1275,15 +1285,15 @@ void BitcoinGUI::setEncryptionStatus(int status)
1275
1285
break ;
1276
1286
case WalletModel::Unlocked:
1277
1287
labelWalletEncryptionIcon->show ();
1278
- labelWalletEncryptionIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/lock_open" ). pixmap ( STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE) );
1288
+ labelWalletEncryptionIcon->setThemedPixmap ( QStringLiteral (" :/icons/lock_open" ), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1279
1289
labelWalletEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>unlocked</b>" ));
1280
1290
encryptWalletAction->setChecked (true );
1281
1291
changePassphraseAction->setEnabled (true );
1282
1292
encryptWalletAction->setEnabled (false );
1283
1293
break ;
1284
1294
case WalletModel::Locked:
1285
1295
labelWalletEncryptionIcon->show ();
1286
- labelWalletEncryptionIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/lock_closed" ). pixmap ( STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE) );
1296
+ labelWalletEncryptionIcon->setThemedPixmap ( QStringLiteral (" :/icons/lock_closed" ), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1287
1297
labelWalletEncryptionIcon->setToolTip (tr (" Wallet is <b>encrypted</b> and currently <b>locked</b>" ));
1288
1298
encryptWalletAction->setChecked (true );
1289
1299
changePassphraseAction->setEnabled (true );
@@ -1315,7 +1325,7 @@ void BitcoinGUI::updateProxyIcon()
1315
1325
if (proxy_enabled) {
1316
1326
if (!GUIUtil::HasPixmap (labelProxyIcon)) {
1317
1327
QString ip_port_q = QString::fromStdString (ip_port);
1318
- labelProxyIcon->setPixmap (platformStyle-> SingleColorIcon (" :/icons/proxy" ). pixmap ( STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE) );
1328
+ labelProxyIcon->setThemedPixmap ( (" :/icons/proxy" ), STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
1319
1329
labelProxyIcon->setToolTip (tr (" Proxy is <b>enabled</b>: %1" ).arg (ip_port_q));
1320
1330
} else {
1321
1331
labelProxyIcon->show ();
@@ -1440,9 +1450,10 @@ bool BitcoinGUI::isPrivacyModeActivated() const
1440
1450
return m_mask_values_action->isChecked ();
1441
1451
}
1442
1452
1443
- UnitDisplayStatusBarControl::UnitDisplayStatusBarControl (const PlatformStyle *platformStyle) :
1444
- optionsModel(nullptr ),
1445
- menu(nullptr )
1453
+ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl (const PlatformStyle *platformStyle)
1454
+ : optionsModel(nullptr ),
1455
+ menu(nullptr ),
1456
+ m_platform_style{platformStyle}
1446
1457
{
1447
1458
createContextMenu ();
1448
1459
setToolTip (tr (" Unit to show amounts in. Click to select another unit." ));
@@ -1455,7 +1466,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *pl
1455
1466
}
1456
1467
setMinimumSize (max_width, 0 );
1457
1468
setAlignment (Qt::AlignRight | Qt::AlignVCenter);
1458
- setStyleSheet (QString (" QLabel { color : %1 }" ).arg (platformStyle ->SingleColor ().name ()));
1469
+ setStyleSheet (QString (" QLabel { color : %1 }" ).arg (m_platform_style ->SingleColor ().name ()));
1459
1470
}
1460
1471
1461
1472
/* * So that it responds to button clicks */
@@ -1464,6 +1475,18 @@ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event)
1464
1475
onDisplayUnitsClicked (event->pos ());
1465
1476
}
1466
1477
1478
+ void UnitDisplayStatusBarControl::changeEvent (QEvent* e)
1479
+ {
1480
+ #ifdef Q_OS_MACOS
1481
+ if (e->type () == QEvent::PaletteChange) {
1482
+ QString style = QString (" QLabel { color : %1 }" ).arg (m_platform_style->SingleColor ().name ());
1483
+ if (style != styleSheet ()) {
1484
+ setStyleSheet (style);
1485
+ }
1486
+ }
1487
+ #endif
1488
+ }
1489
+
1467
1490
/* * Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
1468
1491
void UnitDisplayStatusBarControl::createContextMenu ()
1469
1492
{
0 commit comments