2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move EmptyUserpic from data_peer to empty_userpic.

This commit is contained in:
John Preston
2017-12-05 12:43:18 +04:00
parent 68009b6fba
commit 5eeb8143b6
14 changed files with 346 additions and 303 deletions

View File

@@ -30,6 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
#include "ui/toast/toast.h"
#include "ui/empty_userpic.h"
#include "core/click_handler_types.h"
#include "storage/localstorage.h"
#include "auth_session.h"
@@ -643,7 +644,9 @@ ConfirmInviteBox::ConfirmInviteBox(QWidget*, const QString &title, bool isChanne
}
}
if (!_photo) {
_photoEmpty.set(0, title);
_photoEmpty = std::make_unique<Ui::EmptyUserpic>(
Data::PeerUserpicColor(0),
title);
}
}
@@ -693,7 +696,7 @@ void ConfirmInviteBox::paintEvent(QPaintEvent *e) {
if (_photo) {
p.drawPixmap((width() - st::confirmInvitePhotoSize) / 2, st::confirmInvitePhotoTop, _photo->pixCircled(st::confirmInvitePhotoSize, st::confirmInvitePhotoSize));
} else {
_photoEmpty.paint(p, (width() - st::confirmInvitePhotoSize) / 2, st::confirmInvitePhotoTop, width(), st::confirmInvitePhotoSize);
_photoEmpty->paint(p, (width() - st::confirmInvitePhotoSize) / 2, st::confirmInvitePhotoTop, width(), st::confirmInvitePhotoSize);
}
int sumWidth = _participants.size() * _userWidth;
@@ -703,3 +706,5 @@ void ConfirmInviteBox::paintEvent(QPaintEvent *e) {
left += _userWidth;
}
}
ConfirmInviteBox::~ConfirmInviteBox() = default;