Show temporary placeholder topic icon.

This commit is contained in:
John Preston 2022-10-04 21:02:40 +04:00
parent 5d43073efa
commit 2781fe2c34
2 changed files with 11 additions and 2 deletions

View file

@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "settings/settings_common.h"
#include "apiwrap.h"
#include "styles/style_chat_helpers.h"
namespace {
@ -77,7 +78,8 @@ namespace {
if (state->chosen) {
state->chosen->paint(p, args);
} else {
p.fillRect(clip, Qt::red);
// #TODO forum
st::stickersPremium.paint(p, 0, 0, result->width());
}
}, result->lifetime());
result->setClickedCallback([=] {

View file

@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item.h"
#include "ui/painter.h"
#include "styles/style_dialogs.h"
#include "styles/style_chat_helpers.h"
namespace Data {
@ -216,14 +217,20 @@ void ForumTopic::paintUserpic(
Painter &p,
std::shared_ptr<Data::CloudImageView> &view,
const Dialogs::Ui::PaintContext &context) const {
const auto &st = context.st;
if (_icon) {
const auto &st = context.st;
_icon->paint(p, {
.preview = st::windowBgOver->c,
.now = context.now,
.position = QPoint(st->padding.left(), st->padding.top()),
.paused = context.paused,
});
} else {
// #TODO forum
st::stickersPremium.paint(
p,
QPoint(st->padding.left(), st->padding.top()),
st->padding.left() * 2 + st::stickersPremium.width());
}
}