Fixed verified icon and gift status together in profile top bar.
This commit is contained in:
@@ -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 }};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user