1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

MaskablePixmapWidget: white background, removed circular mask

This commit is contained in:
krepa098 2014-09-27 16:37:16 +02:00
parent 97b5599651
commit de7ade033a
4 changed files with 3 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -36,7 +36,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
headWidget = new QWidget();
nameLabel = new CroppingLabel();
avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask_circle.png");
avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png");
QHBoxLayout *headLayout = new QHBoxLayout(), *mainFootLayout = new QHBoxLayout();
headTextLayout = new QVBoxLayout();
QVBoxLayout *mainLayout = new QVBoxLayout();

View File

@ -42,7 +42,8 @@ void MaskablePixmapWidget::paintEvent(QPaintEvent *)
QPoint offset((width() - pixmap.size().width())/2,(height() - pixmap.size().height())/2); // centering the pixmap
QPainter painter(&tmp);
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
painter.fillRect(0,0,width(),height(),Qt::white);
painter.drawPixmap(offset,pixmap);
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
painter.drawPixmap(0,0,mask);