mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
fix: badge improvements
This commit is contained in:
parent
15ee46dab4
commit
b806e714a6
1 changed files with 8 additions and 1 deletions
|
@ -315,7 +315,7 @@ Cover::Cover(
|
|||
[=] {
|
||||
return controller->isGifPausedAtLeastFor(
|
||||
Window::GifPauseReason::Layer);
|
||||
}))
|
||||
}, 0, BadgeType::None | BadgeType::AyuGram | BadgeType::Extera))
|
||||
, _userpic(topic
|
||||
? nullptr
|
||||
: object_ptr<Ui::UserpicButton>(
|
||||
|
@ -368,6 +368,10 @@ Cover::Cover(
|
|||
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None});
|
||||
}
|
||||
|
||||
_devBadge->updated() | rpl::start_with_next([=] {
|
||||
refreshNameGeometry(width());
|
||||
}, _name->lifetime());
|
||||
|
||||
initViewers(std::move(title));
|
||||
setupChildGeometry();
|
||||
|
||||
|
@ -589,6 +593,9 @@ void Cover::refreshNameGeometry(int newWidth) {
|
|||
if (const auto widget = _badge->widget()) {
|
||||
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
||||
}
|
||||
if (const auto widget = _devBadge->widget()) {
|
||||
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
||||
}
|
||||
_name->resizeToNaturalWidth(nameWidth);
|
||||
_name->moveToLeft(_st.nameLeft, _st.nameTop, newWidth);
|
||||
const auto badgeLeft = _st.nameLeft + _name->width();
|
||||
|
|
Loading…
Add table
Reference in a new issue