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,
|
from,
|
||||||
videoUserpic,
|
videoUserpic,
|
||||||
context,
|
context,
|
||||||
context.narrow
|
(context.narrow
|
||||||
&& !badgesState.empty()
|
&& !badgesState.empty()
|
||||||
&& !draft
|
&& !draft
|
||||||
&& item
|
&& item
|
||||||
&& !item->isEmpty());
|
&& !item->isEmpty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto nameleft = context.st->nameLeft;
|
const auto nameleft = context.st->nameLeft;
|
||||||
|
@ -705,12 +705,46 @@ void PaintRow(
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setFont(st::semiboldFont);
|
p.setFont(st::semiboldFont);
|
||||||
|
const auto paintPeerBadge = [&] {
|
||||||
|
const auto badgeWidth = rowBadge.drawGetWidth(p, {
|
||||||
|
.peer = from,
|
||||||
|
.rectForName = rectForName,
|
||||||
|
.nameWidth = rowName.maxWidth(),
|
||||||
|
.outerWidth = context.width,
|
||||||
|
.verified = (context.active
|
||||||
|
? &st::dialogsVerifiedIconActive
|
||||||
|
: context.selected
|
||||||
|
? &st::dialogsVerifiedIconOver
|
||||||
|
: &st::dialogsVerifiedIcon),
|
||||||
|
.premium = &ThreeStateIcon(
|
||||||
|
st::dialogsPremiumIcon,
|
||||||
|
context.active,
|
||||||
|
context.selected),
|
||||||
|
.scam = (context.active
|
||||||
|
? &st::dialogsScamFgActive
|
||||||
|
: context.selected
|
||||||
|
? &st::dialogsScamFgOver
|
||||||
|
: &st::dialogsScamFg),
|
||||||
|
.premiumFg = (context.active
|
||||||
|
? &st::dialogsVerifiedIconBgActive
|
||||||
|
: context.selected
|
||||||
|
? &st::dialogsVerifiedIconBgOver
|
||||||
|
: &st::dialogsVerifiedIconBg),
|
||||||
|
.customEmojiRepaint = customEmojiRepaint,
|
||||||
|
.now = context.now,
|
||||||
|
.paused = context.paused,
|
||||||
|
});
|
||||||
|
rectForName.setWidth(rectForName.width() - badgeWidth);
|
||||||
|
};
|
||||||
if (flags
|
if (flags
|
||||||
& (Flag::SavedMessages
|
& (Flag::SavedMessages
|
||||||
| Flag::RepliesMessages
|
| Flag::RepliesMessages
|
||||||
| Flag::VerifyCodes
|
| Flag::VerifyCodes
|
||||||
| Flag::HiddenAuthor
|
| Flag::HiddenAuthor
|
||||||
| Flag::MyNotes)) {
|
| Flag::MyNotes)) {
|
||||||
|
if (!context.search && (flags & Flag::VerifyCodes)) {
|
||||||
|
paintPeerBadge();
|
||||||
|
}
|
||||||
auto text = (flags & Flag::SavedMessages)
|
auto text = (flags & Flag::SavedMessages)
|
||||||
? tr::lng_saved_messages(tr::now)
|
? tr::lng_saved_messages(tr::now)
|
||||||
: (flags & Flag::RepliesMessages)
|
: (flags & Flag::RepliesMessages)
|
||||||
|
@ -736,35 +770,7 @@ void PaintRow(
|
||||||
text);
|
text);
|
||||||
} else if (from) {
|
} else if (from) {
|
||||||
if ((history || sublist) && !context.search) {
|
if ((history || sublist) && !context.search) {
|
||||||
const auto badgeWidth = rowBadge.drawGetWidth(p, {
|
paintPeerBadge();
|
||||||
.peer = from,
|
|
||||||
.rectForName = rectForName,
|
|
||||||
.nameWidth = rowName.maxWidth(),
|
|
||||||
.outerWidth = context.width,
|
|
||||||
.verified = (context.active
|
|
||||||
? &st::dialogsVerifiedIconActive
|
|
||||||
: context.selected
|
|
||||||
? &st::dialogsVerifiedIconOver
|
|
||||||
: &st::dialogsVerifiedIcon),
|
|
||||||
.premium = &ThreeStateIcon(
|
|
||||||
st::dialogsPremiumIcon,
|
|
||||||
context.active,
|
|
||||||
context.selected),
|
|
||||||
.scam = (context.active
|
|
||||||
? &st::dialogsScamFgActive
|
|
||||||
: context.selected
|
|
||||||
? &st::dialogsScamFgOver
|
|
||||||
: &st::dialogsScamFg),
|
|
||||||
.premiumFg = (context.active
|
|
||||||
? &st::dialogsVerifiedIconBgActive
|
|
||||||
: context.selected
|
|
||||||
? &st::dialogsVerifiedIconBgOver
|
|
||||||
: &st::dialogsVerifiedIconBg),
|
|
||||||
.customEmojiRepaint = customEmojiRepaint,
|
|
||||||
.now = context.now,
|
|
||||||
.paused = context.paused,
|
|
||||||
});
|
|
||||||
rectForName.setWidth(rectForName.width() - badgeWidth);
|
|
||||||
}
|
}
|
||||||
p.setPen(context.active
|
p.setPen(context.active
|
||||||
? st::dialogsNameFgActive
|
? st::dialogsNameFgActive
|
||||||
|
|
Loading…
Add table
Reference in a new issue