qt: Make CoinControlDialog aware of runtime palette change

This change fixes the GUI when changing appearance on macOS.
This commit is contained in:
Hennadii Stepanov committed 2021-05-01 15:07:11 +03:00
1 parent 97a6b5e06a
commit 2b622d4ace
2 files changed
+12

No files matched your search

+9
View File
@@ -562,6 +562,15 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
label->setVisible(nChange < 0);
}
void CoinControlDialog::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
updateView();
}
#endif
}
void CoinControlDialog::updateView()
{
if (!model || !model->getOptionsModel() || !model->getAddressTableModel())
+3
View File
@@ -51,6 +51,9 @@ public:
static QList<CAmount> payAmounts;
static bool fSubtractFeeFromAmount;
protected:
void changeEvent(QEvent* e) override;
private:
Ui::CoinControlDialog *ui;
CCoinControl& m_coin_control;