Calc: update exchange icon on skin change

This commit is contained in:
tobtoht
2021-02-03 20:40:35 +01:00
parent e0f7473ed4
commit 904432ea82
7 changed files with 54 additions and 4 deletions
+7 -2
View File
@@ -6,6 +6,8 @@
#include "calcwidget.h"
#include "ui_calcwidget.h"
#include "mainwindow.h"
#include "components.h"
#include "utils/ColorScheme.h"
CalcWidget::CalcWidget(QWidget *parent) :
QWidget(parent),
@@ -15,8 +17,7 @@ CalcWidget::CalcWidget(QWidget *parent) :
m_ctx = MainWindow::getContext();
ui->imageExchange->setBackgroundRole(QPalette::Base);
QPixmap pm(":/assets/images/exchange.png");
ui->imageExchange->setPixmap(pm);
ui->imageExchange->setAssets(":/assets/images/exchange.png", ":/assets/images/exchange_white.png");
ui->imageExchange->setScaledContents(true);
ui->imageExchange->setFixedSize(26, 26);
@@ -134,6 +135,10 @@ void CalcWidget::initComboBox() {
this->m_comboBoxInit = true;
}
void CalcWidget::skinChanged() {
ui->imageExchange->setMode(ColorScheme::hasDarkBackground(this));
}
CalcWidget::~CalcWidget() {
delete ui;
}