init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
48
Telegram/SourceFiles/ui/userpic_view.h
Normal file
48
Telegram/SourceFiles/ui/userpic_view.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "base/weak_ptr.h"
|
||||
|
||||
#include <QtGui/QImage>
|
||||
|
||||
namespace Ui {
|
||||
|
||||
class EmptyUserpic;
|
||||
|
||||
[[nodiscard]] float64 ForumUserpicRadiusMultiplier();
|
||||
|
||||
enum class PeerUserpicShape : uint8 {
|
||||
Auto,
|
||||
Circle,
|
||||
Forum,
|
||||
Monoforum,
|
||||
};
|
||||
|
||||
struct PeerUserpicView {
|
||||
[[nodiscard]] bool null() const {
|
||||
return cached.isNull() && !cloud && empty.null();
|
||||
}
|
||||
|
||||
QImage cached;
|
||||
std::shared_ptr<QImage> cloud;
|
||||
base::weak_ptr<const EmptyUserpic> empty;
|
||||
uint32 paletteVersion : 30 = 0;
|
||||
uint32 shape : 2 = 0;
|
||||
};
|
||||
|
||||
[[nodiscard]] bool PeerUserpicLoading(const PeerUserpicView &view);
|
||||
|
||||
void ValidateUserpicCache(
|
||||
PeerUserpicView &view,
|
||||
const QImage *cloud,
|
||||
const EmptyUserpic *empty,
|
||||
int size,
|
||||
PeerUserpicShape shape);
|
||||
|
||||
} // namespace Ui
|
||||
Reference in New Issue
Block a user