mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-23 20:38:07 +01:00
qt: Make TransactionView aware of runtime palette change
This change fixes the GUI when changing appearance on macOS.
This commit is contained in:
@@ -37,8 +37,8 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
|
TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent)
|
||||||
QWidget(parent)
|
: QWidget(parent), m_platform_style{platformStyle}
|
||||||
{
|
{
|
||||||
// Build filter row
|
// Build filter row
|
||||||
setContentsMargins(0,0,0,0);
|
setContentsMargins(0,0,0,0);
|
||||||
@@ -243,6 +243,20 @@ void TransactionView::setModel(WalletModel *_model)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransactionView::changeEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
if (e->type() == QEvent::PaletteChange) {
|
||||||
|
watchOnlyWidget->setItemIcon(
|
||||||
|
TransactionFilterProxy::WatchOnlyFilter_Yes,
|
||||||
|
m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_plus")));
|
||||||
|
watchOnlyWidget->setItemIcon(
|
||||||
|
TransactionFilterProxy::WatchOnlyFilter_No,
|
||||||
|
m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_minus")));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void TransactionView::chooseDate(int idx)
|
void TransactionView::chooseDate(int idx)
|
||||||
{
|
{
|
||||||
if (!transactionProxyModel) return;
|
if (!transactionProxyModel) return;
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ public:
|
|||||||
MINIMUM_COLUMN_WIDTH = 23
|
MINIMUM_COLUMN_WIDTH = 23
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void changeEvent(QEvent* e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WalletModel *model{nullptr};
|
WalletModel *model{nullptr};
|
||||||
TransactionFilterProxy *transactionProxyModel{nullptr};
|
TransactionFilterProxy *transactionProxyModel{nullptr};
|
||||||
@@ -85,6 +88,8 @@ private:
|
|||||||
|
|
||||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
|
||||||
|
const PlatformStyle* m_platform_style;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void contextualMenu(const QPoint &);
|
void contextualMenu(const QPoint &);
|
||||||
void dateRangeChanged();
|
void dateRangeChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user