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
2021-04-08 21:36:11 +03:00
parent 97a6b5e06a
commit 2b622d4ace
2 changed files with 12 additions and 0 deletions

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())

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;