|
@ -1,6 +1,8 @@ |
|
|
// Copyright 2019-2022 The Hush developers
|
|
|
// Copyright 2019-2022 The Hush developers
|
|
|
// Released under the GPLv3
|
|
|
// Released under the GPLv3
|
|
|
#include "fillediconlabel.h" |
|
|
#include "fillediconlabel.h" |
|
|
|
|
|
#include "settings.h" |
|
|
|
|
|
#include "guiconstants.h" |
|
|
|
|
|
|
|
|
FilledIconLabel::FilledIconLabel(QWidget* parent) : |
|
|
FilledIconLabel::FilledIconLabel(QWidget* parent) : |
|
|
QLabel(parent) { |
|
|
QLabel(parent) { |
|
@ -20,8 +22,23 @@ void FilledIconLabel::resizeEvent(QResizeEvent*) { |
|
|
|
|
|
|
|
|
QPixmap scaled = basePm.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation); |
|
|
QPixmap scaled = basePm.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation); |
|
|
|
|
|
|
|
|
|
|
|
QString theme_name = Settings::getInstance()->get_theme_name(); |
|
|
|
|
|
QColor color; |
|
|
|
|
|
if (theme_name == "blue"){ |
|
|
|
|
|
color = COLOR_BLUE_BG; |
|
|
|
|
|
}else if(theme_name == "light"){ |
|
|
|
|
|
color = COLOR_LIGHT_BG; |
|
|
|
|
|
}else if(theme_name == "dark"){ |
|
|
|
|
|
color = COLOR_DARK_BG; |
|
|
|
|
|
}else if(theme_name =="midnight"){ |
|
|
|
|
|
color = COLOR_MIDNIGHT_BG; |
|
|
|
|
|
}else{ |
|
|
|
|
|
color = COLOR_DEFAULT_BG; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
QPixmap p(sz); |
|
|
QPixmap p(sz); |
|
|
p.fill(Qt::white); |
|
|
p.fill(color); |
|
|
|
|
|
|
|
|
QPainter painter(&p); |
|
|
QPainter painter(&p); |
|
|
painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled); |
|
|
painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled); |
|
|
|
|
|
|
|
|