feat: new badges
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 517 B |
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
BIN
Telegram/Resources/icons/ayu/extera_official.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
Telegram/Resources/icons/ayu/extera_official@2x.png
Normal file
After Width: | Height: | Size: 882 B |
BIN
Telegram/Resources/icons/ayu/extera_official@3x.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
|
@ -30,6 +30,7 @@ inChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgInDateFgSelected }};
|
||||||
outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }};
|
outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }};
|
||||||
outChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgOutDateFgSelected }};
|
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 }};
|
winEnterWithGuestIcon: icon {{ "ayu/ghost_tray", windowFg }};
|
||||||
|
|
|
@ -187,14 +187,19 @@ void Badge::setContent(Content content) {
|
||||||
st::attentionButtonFg);
|
st::attentionButtonFg);
|
||||||
}, _view->lifetime());
|
}, _view->lifetime());
|
||||||
} break;
|
} break;
|
||||||
case BadgeType::AyuGram:
|
case BadgeType::Extera:
|
||||||
case BadgeType::Extera: {
|
case BadgeType::ExteraSupporter: {
|
||||||
const auto icon = &st::infoExteraBadge;
|
const auto icon = (_content.badge == BadgeType::Extera
|
||||||
_view->resize(icon->size());
|
? &st::infoExteraOfficialBadge
|
||||||
|
: &st::infoExteraSupporterBadge);
|
||||||
|
const auto skip = st::infoVerifiedCheckPosition.x();
|
||||||
|
_view->resize(
|
||||||
|
icon->width() + skip,
|
||||||
|
icon->height());
|
||||||
_view->paintRequest(
|
_view->paintRequest(
|
||||||
) | rpl::start_with_next([=, check = _view.data()]{
|
) | rpl::start_with_next([=, check = _view.data()]{
|
||||||
Painter p(check);
|
Painter p(check);
|
||||||
icon->paint(p, 0, 0, check->width());
|
icon->paint(p, skip, 0, check->width());
|
||||||
}, _view->lifetime());
|
}, _view->lifetime());
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ enum class BadgeType {
|
||||||
Premium = 0x04,
|
Premium = 0x04,
|
||||||
Scam = 0x08,
|
Scam = 0x08,
|
||||||
Fake = 0x10,
|
Fake = 0x10,
|
||||||
AyuGram = 0x20,
|
Extera = 0x20,
|
||||||
Extera = 0x40,
|
ExteraSupporter = 0x40,
|
||||||
};
|
};
|
||||||
inline constexpr bool is_flag_type(BadgeType) { return true; }
|
inline constexpr bool is_flag_type(BadgeType) { return true; }
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@ Cover::Cover(
|
||||||
Window::GifPauseReason::Layer);
|
Window::GifPauseReason::Layer);
|
||||||
},
|
},
|
||||||
0,
|
0,
|
||||||
BadgeType::None | BadgeType::AyuGram | BadgeType::Extera))
|
BadgeType::None | BadgeType::Extera | BadgeType::ExteraSupporter))
|
||||||
, _userpic(topic
|
, _userpic(topic
|
||||||
? nullptr
|
? nullptr
|
||||||
: object_ptr<Ui::UserpicButton>(
|
: object_ptr<Ui::UserpicButton>(
|
||||||
|
@ -418,10 +418,10 @@ Cover::Cover(
|
||||||
refreshNameGeometry(width());
|
refreshNameGeometry(width());
|
||||||
}, _name->lifetime());
|
}, _name->lifetime());
|
||||||
|
|
||||||
if (isAyuGramRelated(getBareID(_peer))) {
|
if (isExteraRelated(getBareID(_peer)) || isAyuGramRelated(getBareID(_peer))) {
|
||||||
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::AyuGram});
|
|
||||||
} else if (isExteraRelated(getBareID(_peer))) {
|
|
||||||
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::Extera});
|
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::Extera});
|
||||||
|
} else if (false) {
|
||||||
|
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::ExteraSupporter});
|
||||||
} else {
|
} else {
|
||||||
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None});
|
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None});
|
||||||
}
|
}
|
||||||
|
@ -770,7 +770,12 @@ void Cover::refreshNameGeometry(int newWidth) {
|
||||||
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
||||||
}
|
}
|
||||||
if (const auto widget = _devBadge->widget()) {
|
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;
|
auto nameLeft = _st.nameLeft;
|
||||||
const auto badgeTop = _st.nameTop;
|
const auto badgeTop = _st.nameTop;
|
||||||
|
@ -789,7 +794,10 @@ void Cover::refreshNameGeometry(int newWidth) {
|
||||||
const auto badgeLeft = nameLeft + _name->width();
|
const auto badgeLeft = nameLeft + _name->width();
|
||||||
_badge->move(badgeLeft, badgeTop, badgeBottom);
|
_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 devBadgeTop = _st.nameTop;
|
||||||
const auto devBadgeBottom = _st.nameTop + _name->height();
|
const auto devBadgeBottom = _st.nameTop + _name->height();
|
||||||
_devBadge->move(devBadgeLeft, devBadgeTop, devBadgeBottom);
|
_devBadge->move(devBadgeLeft, devBadgeTop, devBadgeBottom);
|
||||||
|
|