prettify loading dialog

This commit is contained in:
adityapk00
2018-11-04 20:46:26 -08:00
parent d5e3af588e
commit 2b253dd46f
7 changed files with 106 additions and 96 deletions

22
src/fillediconlabel.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "fillediconlabel.h"
FilledIconLabel::FilledIconLabel(QWidget* parent) :
QLabel(parent) {
this->setMinimumSize(1, 1);
setScaledContents(false);
}
void FilledIconLabel::resizeEvent(QResizeEvent*) {
// Top pixmap
QIcon icon(":/icons/res/icon.ico");
QSize sz = size();
qDebug() << sz;
QPixmap p(sz);
p.fill(Qt::white);
QPainter painter(&p);
painter.drawPixmap((sz.width() - sz.height()) / 2, 0,
icon.pixmap(sz.height(), sz.height()));
QLabel::setPixmap(p);
}