zcashd pane on main tab widget

This commit is contained in:
Aditya Kulkarni
2018-11-06 15:00:10 -08:00
parent a2f6768f6c
commit 5fc905c926
10 changed files with 196 additions and 13 deletions

View File

@@ -6,17 +6,20 @@ FilledIconLabel::FilledIconLabel(QWidget* parent) :
setScaledContents(false);
}
void FilledIconLabel::setBasePixmap(QPixmap pm) {
basePm = pm;
}
void FilledIconLabel::resizeEvent(QResizeEvent*) {
// Top pixmap
QIcon icon(":/icons/res/icon.ico");
QSize sz = size();
qDebug() << sz;
// Top pixmap
QSize sz = size();
QPixmap scaled = basePm.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap p(sz);
p.fill(Qt::white);
QPainter painter(&p);
painter.drawPixmap((sz.width() - sz.height()) / 2, 0,
icon.pixmap(sz.height(), sz.height()));
painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled);
QLabel::setPixmap(p);
}