2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Allow emoji status edit from self profile.

This commit is contained in:
John Preston
2022-08-09 20:15:42 +03:00
parent 21fd381778
commit 165d3143de
9 changed files with 158 additions and 55 deletions

View File

@@ -764,8 +764,6 @@ void MainMenu::paintEvent(QPaintEvent *e) {
- st::mainMenuCoverNameLeft
- _toggleAccounts->rightSkip();
p.setFont(st::semiboldFont);
p.setPen(st::windowBoldFg);
const auto user = _controller->session().user();
if (_nameVersion < user->nameVersion()) {
_nameVersion = user->nameVersion();
@@ -774,11 +772,37 @@ void MainMenu::paintEvent(QPaintEvent *e) {
user->name(),
Ui::NameTextOptions());
}
const auto paused = _controller->isGifPausedAtLeastFor(
GifPauseReason::Layer);
const auto badgeWidth = user->emojiStatusId()
? _badge.drawGetWidth(
p,
QRect(
st::mainMenuCoverNameLeft,
st::mainMenuCoverNameTop,
widthText,
st::msgNameStyle.font->height),
_name.maxWidth(),
width(),
{
.peer = user,
.verified = nullptr,
.premium = &st::dialogsPremiumIcon,
.scam = nullptr,
.preview = st::windowBgOver->c,
.customEmojiRepaint = [=] { update(); },
.now = crl::now(),
.paused = paused,
})
: 0;
p.setFont(st::semiboldFont);
p.setPen(st::windowBoldFg);
_name.drawLeftElided(
p,
st::mainMenuCoverNameLeft,
st::mainMenuCoverNameTop,
widthText,
widthText - badgeWidth,
width());
p.setFont(st::mainMenuPhoneFont);
p.setPen(st::windowSubTextFg);