2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-23 02:37:11 +00:00
tdesktop/Telegram/SourceFiles/ui/userpic_view.h

49 lines
970 B
C
Raw Permalink Normal View History

/*
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();
2025-06-03 17:17:36 +04:00
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;
2025-06-03 17:17:36 +04:00
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,
2025-06-03 17:17:36 +04:00
PeerUserpicShape shape);
} // namespace Ui