diff --git a/Telegram/Resources/icons/ayu/exterabadge.png b/Telegram/Resources/icons/ayu/extera_badge.png similarity index 100% rename from Telegram/Resources/icons/ayu/exterabadge.png rename to Telegram/Resources/icons/ayu/extera_badge.png diff --git a/Telegram/Resources/icons/ayu/exterabadge@2x.png b/Telegram/Resources/icons/ayu/extera_badge@2x.png similarity index 100% rename from Telegram/Resources/icons/ayu/exterabadge@2x.png rename to Telegram/Resources/icons/ayu/extera_badge@2x.png diff --git a/Telegram/Resources/icons/ayu/exterabadge@3x.png b/Telegram/Resources/icons/ayu/extera_badge@3x.png similarity index 100% rename from Telegram/Resources/icons/ayu/exterabadge@3x.png rename to Telegram/Resources/icons/ayu/extera_badge@3x.png diff --git a/Telegram/Resources/icons/ayu/extera_official.png b/Telegram/Resources/icons/ayu/extera_official.png new file mode 100644 index 000000000..8786c7c14 Binary files /dev/null and b/Telegram/Resources/icons/ayu/extera_official.png differ diff --git a/Telegram/Resources/icons/ayu/extera_official@2x.png b/Telegram/Resources/icons/ayu/extera_official@2x.png new file mode 100644 index 000000000..641fd8c14 Binary files /dev/null and b/Telegram/Resources/icons/ayu/extera_official@2x.png differ diff --git a/Telegram/Resources/icons/ayu/extera_official@3x.png b/Telegram/Resources/icons/ayu/extera_official@3x.png new file mode 100644 index 000000000..234720bbb Binary files /dev/null and b/Telegram/Resources/icons/ayu/extera_official@3x.png differ diff --git a/Telegram/SourceFiles/ayu/ui/ayu_icons.style b/Telegram/SourceFiles/ayu/ui/ayu_icons.style index 4f4934b86..2cf747de7 100644 --- a/Telegram/SourceFiles/ayu/ui/ayu_icons.style +++ b/Telegram/SourceFiles/ayu/ui/ayu_icons.style @@ -30,6 +30,7 @@ inChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgInDateFgSelected }}; outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }}; outChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgOutDateFgSelected }}; -infoExteraBadge: icon {{ "ayu/exterabadge", profileVerifiedCheckBg }}; +infoExteraOfficialBadge: icon {{ "ayu/extera_official", profileVerifiedCheckBg }}; +infoExteraSupporterBadge: icon {{ "ayu/extera_badge", profileVerifiedCheckBg }}; winEnterWithGuestIcon: icon {{ "ayu/ghost_tray", windowFg }}; diff --git a/Telegram/SourceFiles/info/profile/info_profile_badge.cpp b/Telegram/SourceFiles/info/profile/info_profile_badge.cpp index 170654838..f04ffbf29 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_badge.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_badge.cpp @@ -187,14 +187,19 @@ void Badge::setContent(Content content) { st::attentionButtonFg); }, _view->lifetime()); } break; - case BadgeType::AyuGram: - case BadgeType::Extera: { - const auto icon = &st::infoExteraBadge; - _view->resize(icon->size()); + case BadgeType::Extera: + case BadgeType::ExteraSupporter: { + const auto icon = (_content.badge == BadgeType::Extera + ? &st::infoExteraOfficialBadge + : &st::infoExteraSupporterBadge); + const auto skip = st::infoVerifiedCheckPosition.x(); + _view->resize( + icon->width() + skip, + icon->height()); _view->paintRequest( ) | rpl::start_with_next([=, check = _view.data()]{ Painter p(check); - icon->paint(p, 0, 0, check->width()); + icon->paint(p, skip, 0, check->width()); }, _view->lifetime()); } break; } diff --git a/Telegram/SourceFiles/info/profile/info_profile_badge.h b/Telegram/SourceFiles/info/profile/info_profile_badge.h index cffe08a81..219b8dc3f 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_badge.h +++ b/Telegram/SourceFiles/info/profile/info_profile_badge.h @@ -42,8 +42,8 @@ enum class BadgeType { Premium = 0x04, Scam = 0x08, Fake = 0x10, - AyuGram = 0x20, - Extera = 0x40, + Extera = 0x20, + ExteraSupporter = 0x40, }; inline constexpr bool is_flag_type(BadgeType) { return true; } diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index 0ca3ae4b3..7b2796cce 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -369,7 +369,7 @@ Cover::Cover( Window::GifPauseReason::Layer); }, 0, - BadgeType::None | BadgeType::AyuGram | BadgeType::Extera)) + BadgeType::None | BadgeType::Extera | BadgeType::ExteraSupporter)) , _userpic(topic ? nullptr : object_ptr( @@ -418,10 +418,10 @@ Cover::Cover( refreshNameGeometry(width()); }, _name->lifetime()); - if (isAyuGramRelated(getBareID(_peer))) { - _devBadge->setContent(Info::Profile::Badge::Content{BadgeType::AyuGram}); - } else if (isExteraRelated(getBareID(_peer))) { + if (isExteraRelated(getBareID(_peer)) || isAyuGramRelated(getBareID(_peer))) { _devBadge->setContent(Info::Profile::Badge::Content{BadgeType::Extera}); + } else if (false) { + _devBadge->setContent(Info::Profile::Badge::Content{BadgeType::ExteraSupporter}); } else { _devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None}); } @@ -770,7 +770,12 @@ void Cover::refreshNameGeometry(int newWidth) { nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width(); } if (const auto widget = _devBadge->widget()) { - nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width(); + nameWidth -= st::infoVerifiedCheckPosition.x() + + widget->width() + + (_badge->widget() + ? (_badge->widget()->width() + + st::infoVerifiedCheckPosition.x()) + : 0); } auto nameLeft = _st.nameLeft; const auto badgeTop = _st.nameTop; @@ -789,7 +794,10 @@ void Cover::refreshNameGeometry(int newWidth) { const auto badgeLeft = nameLeft + _name->width(); _badge->move(badgeLeft, badgeTop, badgeBottom); - const auto devBadgeLeft = badgeLeft + (_badge->widget() ? (_badge->widget()->width() + 2) : 0) + 4; + const auto devBadgeLeft = badgeLeft + + (_badge->widget() + ? (_badge->widget()->width() + st::infoVerifiedCheckPosition.x()) + : 0); const auto devBadgeTop = _st.nameTop; const auto devBadgeBottom = _st.nameTop + _name->height(); _devBadge->move(devBadgeLeft, devBadgeTop, devBadgeBottom);