mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-31 17:41:16 +00:00
Added support of profile color to top bar for gradient backgrounds.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user