feat: avatar corners

This commit is contained in:
AlexeyZavar
2026-03-01 03:14:19 +03:00
parent c26d158bc7
commit 38917114f0
42 changed files with 701 additions and 66 deletions
+12
View File
@@ -54,6 +54,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_facade.h"
#include "storage/storage_shared_media.h"
// AyuGram includes
#include "ayu/ui/ayu_userpic.h"
namespace {
constexpr auto kUpdateFullPeerTimeout = crl::time(5000); // Not more than once in 5 seconds.
@@ -484,6 +488,14 @@ QImage PeerData::GenerateUserpicImage(
Ui::PeerUserpicView &view,
int size,
std::optional<int> radius) {
if (!radius) {
const auto shape = peer->isForum()
? Ui::PeerUserpicShape::Forum
: Ui::PeerUserpicShape::Circle;
if (AyuUserpic::ShouldOverrideShape(shape)) {
radius = AyuUserpic::ComputeRadius(size);
}
}
if (const auto userpic = peer->userpicCloudImage(view)) {
auto image = userpic->scaled(
{ size, size },