mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show verify badge on Verifications Codes.
This commit is contained in:
parent
3aa15c979d
commit
2bb1c5d39b
1 changed files with 37 additions and 31 deletions
|
@ -411,11 +411,11 @@ void PaintRow(
|
|||
from,
|
||||
videoUserpic,
|
||||
context,
|
||||
context.narrow
|
||||
(context.narrow
|
||||
&& !badgesState.empty()
|
||||
&& !draft
|
||||
&& item
|
||||
&& !item->isEmpty());
|
||||
&& !item->isEmpty()));
|
||||
}
|
||||
|
||||
const auto nameleft = context.st->nameLeft;
|
||||
|
@ -705,37 +705,7 @@ void PaintRow(
|
|||
}
|
||||
|
||||
p.setFont(st::semiboldFont);
|
||||
if (flags
|
||||
& (Flag::SavedMessages
|
||||
| Flag::RepliesMessages
|
||||
| Flag::VerifyCodes
|
||||
| Flag::HiddenAuthor
|
||||
| Flag::MyNotes)) {
|
||||
auto text = (flags & Flag::SavedMessages)
|
||||
? tr::lng_saved_messages(tr::now)
|
||||
: (flags & Flag::RepliesMessages)
|
||||
? tr::lng_replies_messages(tr::now)
|
||||
: (flags & Flag::VerifyCodes)
|
||||
? tr::lng_verification_codes(tr::now)
|
||||
: (flags & Flag::MyNotes)
|
||||
? tr::lng_my_notes(tr::now)
|
||||
: tr::lng_hidden_author_messages(tr::now);
|
||||
const auto textWidth = st::semiboldFont->width(text);
|
||||
if (textWidth > rectForName.width()) {
|
||||
text = st::semiboldFont->elided(text, rectForName.width());
|
||||
}
|
||||
p.setPen(context.active
|
||||
? st::dialogsNameFgActive
|
||||
: context.selected
|
||||
? st::dialogsNameFgOver
|
||||
: st::dialogsNameFg);
|
||||
p.drawTextLeft(
|
||||
rectForName.left(),
|
||||
rectForName.top(),
|
||||
context.width,
|
||||
text);
|
||||
} else if (from) {
|
||||
if ((history || sublist) && !context.search) {
|
||||
const auto paintPeerBadge = [&] {
|
||||
const auto badgeWidth = rowBadge.drawGetWidth(p, {
|
||||
.peer = from,
|
||||
.rectForName = rectForName,
|
||||
|
@ -765,6 +735,42 @@ void PaintRow(
|
|||
.paused = context.paused,
|
||||
});
|
||||
rectForName.setWidth(rectForName.width() - badgeWidth);
|
||||
};
|
||||
if (flags
|
||||
& (Flag::SavedMessages
|
||||
| Flag::RepliesMessages
|
||||
| Flag::VerifyCodes
|
||||
| Flag::HiddenAuthor
|
||||
| Flag::MyNotes)) {
|
||||
if (!context.search && (flags & Flag::VerifyCodes)) {
|
||||
paintPeerBadge();
|
||||
}
|
||||
auto text = (flags & Flag::SavedMessages)
|
||||
? tr::lng_saved_messages(tr::now)
|
||||
: (flags & Flag::RepliesMessages)
|
||||
? tr::lng_replies_messages(tr::now)
|
||||
: (flags & Flag::VerifyCodes)
|
||||
? tr::lng_verification_codes(tr::now)
|
||||
: (flags & Flag::MyNotes)
|
||||
? tr::lng_my_notes(tr::now)
|
||||
: tr::lng_hidden_author_messages(tr::now);
|
||||
const auto textWidth = st::semiboldFont->width(text);
|
||||
if (textWidth > rectForName.width()) {
|
||||
text = st::semiboldFont->elided(text, rectForName.width());
|
||||
}
|
||||
p.setPen(context.active
|
||||
? st::dialogsNameFgActive
|
||||
: context.selected
|
||||
? st::dialogsNameFgOver
|
||||
: st::dialogsNameFg);
|
||||
p.drawTextLeft(
|
||||
rectForName.left(),
|
||||
rectForName.top(),
|
||||
context.width,
|
||||
text);
|
||||
} else if (from) {
|
||||
if ((history || sublist) && !context.search) {
|
||||
paintPeerBadge();
|
||||
}
|
||||
p.setPen(context.active
|
||||
? st::dialogsNameFgActive
|
||||
|
|
Loading…
Add table
Reference in a new issue