mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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(
|
return controller->isGifPausedAtLeastFor(
|
||||||
Window::GifPauseReason::Layer);
|
Window::GifPauseReason::Layer);
|
||||||
}))
|
}, 0, BadgeType::None | BadgeType::AyuGram | BadgeType::Extera))
|
||||||
, _userpic(topic
|
, _userpic(topic
|
||||||
? nullptr
|
? nullptr
|
||||||
: object_ptr<Ui::UserpicButton>(
|
: object_ptr<Ui::UserpicButton>(
|
||||||
|
@ -368,6 +368,10 @@ Cover::Cover(
|
||||||
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None});
|
_devBadge->setContent(Info::Profile::Badge::Content{BadgeType::None});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_devBadge->updated() | rpl::start_with_next([=] {
|
||||||
|
refreshNameGeometry(width());
|
||||||
|
}, _name->lifetime());
|
||||||
|
|
||||||
initViewers(std::move(title));
|
initViewers(std::move(title));
|
||||||
setupChildGeometry();
|
setupChildGeometry();
|
||||||
|
|
||||||
|
@ -589,6 +593,9 @@ void Cover::refreshNameGeometry(int newWidth) {
|
||||||
if (const auto widget = _badge->widget()) {
|
if (const auto widget = _badge->widget()) {
|
||||||
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
||||||
}
|
}
|
||||||
|
if (const auto widget = _devBadge->widget()) {
|
||||||
|
nameWidth -= st::infoVerifiedCheckPosition.x() + widget->width();
|
||||||
|
}
|
||||||
_name->resizeToNaturalWidth(nameWidth);
|
_name->resizeToNaturalWidth(nameWidth);
|
||||||
_name->moveToLeft(_st.nameLeft, _st.nameTop, newWidth);
|
_name->moveToLeft(_st.nameLeft, _st.nameTop, newWidth);
|
||||||
const auto badgeLeft = _st.nameLeft + _name->width();
|
const auto badgeLeft = _st.nameLeft + _name->width();
|
||||||
|
|
Loading…
Add table
Reference in a new issue