UI/color tweaks from SD

This commit is contained in:
fekt
2023-02-20 19:00:19 -05:00
parent 7dfce16b5f
commit 4969275156
9 changed files with 541 additions and 445 deletions

View File

@@ -1,6 +1,8 @@
// Copyright 2019-2023 The Hush developers
// Copyright 2019-2022 The Hush developers
// Released under the GPLv3
#include "fillediconlabel.h"
#include "settings.h"
#include "guiconstants.h"
FilledIconLabel::FilledIconLabel(QWidget* parent) :
QLabel(parent) {
@@ -20,8 +22,25 @@ void FilledIconLabel::resizeEvent(QResizeEvent*) {
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 if(theme_name =="dragonx"){
color = COLOR_DRAGONX_BG;
}else{
color = COLOR_DEFAULT_BG;
}
QPixmap p(sz);
p.fill(Qt::white);
p.fill(color);
QPainter painter(&p);
painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled);