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:
parent
97b5599651
commit
de7ade033a
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 |
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user