Fixed verified icon and gift status together in profile top bar.

This commit is contained in:
23rd
2025-12-19 06:51:34 +03:00
committed by John Preston
parent 6418af0ada
commit d51dd1cdb5
3 changed files with 21 additions and 7 deletions

View File

@@ -595,7 +595,7 @@ infoRatingDeductedBadge: RoundButton(customEmojiTextBadge) {
infoProfileInaccessibleUserpic: icon {{ "info/inaccessible_userpic", historyPeerUserpicFg }};
infoVerifiedCheckPosition: point(4px, 2px);
infoVerifiedCheckPosition: point(4px, 0px);
infoVerifiedStar: icon {{ "profile_verified_star", profileVerifiedCheckBg }};
infoPremiumStar: icon {{ "profile_premium", profileVerifiedCheckBg }};

View File

@@ -257,6 +257,9 @@ rpl::producer<Badge::Content> BadgeContentForPeer(not_null<PeerData*> peer) {
BadgeValue(peer),
EmojiStatusIdValue(peer)
) | rpl::map([=](BadgeType badge, EmojiStatusId emojiStatusId) {
if (emojiStatusId.collectible) {
return Badge::Content{ BadgeType::Premium, emojiStatusId };
}
if (badge == BadgeType::Verified) {
badge = BadgeType::None;
}

View File

@@ -621,15 +621,26 @@ void TopBar::updateCollectibleStatus() {
_animatedPoints.clear();
_pinnedToTopGifts.clear();
}
if (colorProfile && !colorProfile->palette.empty()) {
const auto verifiedFg = [&]() -> std::optional<QColor> {
if (collectible) {
return Ui::BlendColors(
collectible->edgeColor,
collectible->centerColor,
0.2);
}
if (colorProfile && !colorProfile->palette.empty()) {
return Ui::BlendColors(
colorProfile->palette.back(),
colorProfile->palette.size() == 1 ? Qt::white : Qt::black,
0.2);
}
return std::nullopt;
}();
if (verifiedFg) {
const auto copyStVerified = [&](const style::InfoPeerBadge &st) {
auto result = std::make_unique<style::InfoPeerBadge>(
base::duplicate(st));
auto fg = std::make_shared<style::owned_color>(
Ui::BlendColors(
colorProfile->palette.back(),
colorProfile->palette.size() == 1 ? Qt::white : Qt::black,
0.2));
auto fg = std::make_shared<style::owned_color>(*verifiedFg);
result->premiumFg = fg->color();
return std::shared_ptr<style::InfoPeerBadge>(
result.release(),