mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 21:59:10 +02:00
Merge bitcoin-core/gui#275: Support runtime appearance adjustment on macOS
c231254a65qt: Make TransactionView aware of runtime palette change (Hennadii Stepanov)2b622d4aceqt: Make CoinControlDialog aware of runtime palette change (Hennadii Stepanov)97a6b5e06aqt: Make OverviewPage aware of runtime palette change (Hennadii Stepanov)d05f1b278dqt: Make UnitDisplayStatusBarControl aware of runtime palette change (Hennadii Stepanov)6b2ce65392qt: Replace base class of ClickableLabel with ThemedLabel (Hennadii Stepanov)ff530a2093qt: Use GUIUtil::ThemedLabel class (Hennadii Stepanov)d99ef327a8qt: Add GUIUtil::ThemedLabel class (Hennadii Stepanov)c054720e08qt: Make SignVerifyMessageDialog aware of runtime palette change (Hennadii Stepanov)0dcc3fac43qt: Make SendCoinsEntry aware of runtime palette change (Hennadii Stepanov)fa18d28e12qt: Make RPCConsole aware of runtime palette change (Hennadii Stepanov)f1083826e3qt: Make BitcoinGUI aware of runtime palette change (Hennadii Stepanov)ce17861dc4qt: Make PlatformStyle aware of runtime palette change (Hennadii Stepanov) Pull request description: On macOS switching appearance (Light -> Dark or Dark -> Light) when Bitcoin Core is running makes the GUI pretty unusable. This bug is especially important when a user chose the "Auto" mode to adjust appearance automatically. This PR fixes Bitcoin Core behavior. This is an alternative to #268. ACKs for top commit: Sjors: tACKc231254a65on macOS 11.4 goums: ACKc231254a65promag: Tested ACKc231254a65on macOS Big Sur arm64. jarolrod: tACKc231254a65Tree-SHA512: 122dda3e4c9703f68cec60613c536ca59d04c93f2c03398559f2361b8d279ae534800e8e677d94a33e10e769d00be54295a704e98afa2e986a06146b9f164854
This commit is contained in:
@@ -843,6 +843,25 @@ void RPCConsole::keyPressEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void RPCConsole::changeEvent(QEvent* e)
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
if (e->type() == QEvent::PaletteChange) {
|
||||
ui->clearButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
|
||||
ui->fontBiggerButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/fontbigger")));
|
||||
ui->fontSmallerButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/fontsmaller")));
|
||||
ui->promptIcon->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/prompticon")));
|
||||
|
||||
for (int i = 0; ICON_MAPPING[i].url; ++i) {
|
||||
ui->messagesWidget->document()->addResource(
|
||||
QTextDocument::ImageResource,
|
||||
QUrl(ICON_MAPPING[i].url),
|
||||
platformStyle->SingleColorImage(ICON_MAPPING[i].source).scaled(QSize(consoleFontSize * 2, consoleFontSize * 2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void RPCConsole::message(int category, const QString &message, bool html)
|
||||
{
|
||||
QTime time = QTime::currentTime();
|
||||
|
||||
Reference in New Issue
Block a user