Added support of profile color to top bar for gradient backgrounds.

This commit is contained in:
23rd
2025-10-23 20:43:25 +03:00
parent 7e56174ba9
commit 5f42011c7b
3 changed files with 23 additions and 10 deletions
@@ -7,11 +7,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/top_background_gradient.h"
#include "apiwrap.h"
#include "api/api_peer_colors.h"
#include "data/data_emoji_statuses.h"
#include "data/data_credits.h"
#include "data/data_peer.h"
#include "data/data_star_gift.h"
#include "data/stickers/data_custom_emoji.h"
#include "main/main_session.h"
#include "ui/image/image_prepare.h"
#include "ui/painter.h"
#include "ui/rect.h"
@@ -106,9 +109,19 @@ QImage CreateTopBgGradient(
collectible->edgeColor,
false,
offset);
} else {
return QImage();
}
if (const auto color = peer->session().api().peerColors().colorProfileFor(
peer)) {
if (color->bg.size() > 1) {
return CreateTopBgGradient(
size,
color->bg[1],
color->bg[0],
false,
offset);
}
}
return QImage();
}
const std::vector<PatternPoint> &PatternBgPoints() {