Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark Mode fixes/portability #366

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,14 +1173,12 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty

void BitcoinGUI::changeEvent(QEvent *e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
overviewAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/overview")));
sendCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/send")));
receiveCoinsAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/receiving_addresses")));
historyAction->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/history")));
}
#endif

QMainWindow::changeEvent(e);

Expand Down Expand Up @@ -1511,14 +1509,14 @@ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event)

void UnitDisplayStatusBarControl::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
QString style = QString("QLabel { color : %1 }").arg(m_platform_style->SingleColor().name());
if (style != styleSheet()) {
setStyleSheet(style);
}
}
#endif

QLabel::changeEvent(e);
}

/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
Expand Down
4 changes: 2 additions & 2 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,11 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *

void CoinControlDialog::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
updateView();
}
#endif

QDialog::changeEvent(e);
}

void CoinControlDialog::updateView()
Expand Down
3 changes: 1 addition & 2 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,10 @@ void ThemedLabel::setThemedPixmap(const QString& image_filename, int width, int

void ThemedLabel::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
updateThemedPixmap();
}
#endif

QLabel::changeEvent(e);
}

Expand Down
4 changes: 2 additions & 2 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ void OverviewPage::setWalletModel(WalletModel *model)

void OverviewPage::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
QIcon icon = m_platform_style->SingleColorIcon(QStringLiteral(":/icons/warning"));
ui->labelTransactionsStatus->setIcon(icon);
ui->labelWalletStatus->setIcon(icon);
}
#endif

QWidget::changeEvent(e);
}

void OverviewPage::updateDisplayUnit()
Expand Down
4 changes: 2 additions & 2 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ 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")));
Expand All @@ -896,7 +895,8 @@ void RPCConsole::changeEvent(QEvent* e)
platformStyle->SingleColorImage(ICON_MAPPING[i].source).scaled(QSize(consoleFontSize * 2, consoleFontSize * 2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
}
}
#endif

QWidget::changeEvent(e);
}

void RPCConsole::message(int category, const QString &message, bool html)
Expand Down
4 changes: 2 additions & 2 deletions src/qt/sendcoinsentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ 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

QStackedWidget::changeEvent(e);
}

bool SendCoinsEntry::updateLabel(const QString &address)
Expand Down
4 changes: 2 additions & 2 deletions src/qt/signverifymessagedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ bool SignVerifyMessageDialog::eventFilter(QObject *object, QEvent *event)

void SignVerifyMessageDialog::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
ui->addressBookButton_SM->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/address-book")));
ui->pasteButton_SM->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/editpaste")));
Expand All @@ -297,5 +296,6 @@ void SignVerifyMessageDialog::changeEvent(QEvent* e)
ui->verifyMessageButton_VM->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/transaction_0")));
ui->clearButton_VM->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
}
#endif

QDialog::changeEvent(e);
}
4 changes: 2 additions & 2 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ void TransactionView::setModel(WalletModel *_model)

void TransactionView::changeEvent(QEvent* e)
{
#ifdef Q_OS_MACOS
if (e->type() == QEvent::PaletteChange) {
watchOnlyWidget->setItemIcon(
TransactionFilterProxy::WatchOnlyFilter_Yes,
Expand All @@ -254,7 +253,8 @@ void TransactionView::changeEvent(QEvent* e)
TransactionFilterProxy::WatchOnlyFilter_No,
m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_minus")));
}
#endif

QWidget::changeEvent(e);
}

void TransactionView::chooseDate(int idx)
Expand Down