diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-08 12:31:16 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-05-01 15:07:09 +0300 |
commit | 0dcc3fac433b341eb6e1d3a2fb4d2de1595e8e88 (patch) | |
tree | 8af61b7288a2d2c76d4e873dd18f9a6eb93da1ca | |
parent | fa18d28e1242c2948814df1082ee12c2fecf5403 (diff) |
qt: Make SendCoinsEntry aware of runtime palette change
This change fixes the GUI when changing appearance on macOS.
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 13 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 444dc79a2e..f701bb9615 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -236,6 +236,19 @@ void SendCoinsEntry::updateDisplayUnit() } } +void SendCoinsEntry::changeEvent(QEvent* e) +{ +#ifdef Q_OS_MACOS + if (e->type() == QEvent::PaletteChange) { + ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/address-book"))); + ui->pasteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/editpaste"))); + ui->deleteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove"))); + ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove"))); + ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove"))); + } +#endif +} + bool SendCoinsEntry::updateLabel(const QString &address) { if(!model) diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index 254cc186e2..e682e6423a 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -69,6 +69,9 @@ private Q_SLOTS: void on_pasteButton_clicked(); void updateDisplayUnit(); +protected: + void changeEvent(QEvent* e) override; + private: SendCoinsRecipient recipient; Ui::SendCoinsEntry *ui; |