mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use different color for sponsored sender name.
This commit is contained in:
parent
611be90880
commit
edf93b0031
1 changed files with 12 additions and 6 deletions
|
@ -937,15 +937,21 @@ void Message::paintFromName(
|
||||||
const auto nameText = [&]() -> const Ui::Text::String * {
|
const auto nameText = [&]() -> const Ui::Text::String * {
|
||||||
const auto from = item->displayFrom();
|
const auto from = item->displayFrom();
|
||||||
const auto service = (context.outbg || item->isPost());
|
const auto service = (context.outbg || item->isPost());
|
||||||
|
const auto sponsored = service && item->isSponsored();
|
||||||
|
const auto st = context.st;
|
||||||
if (from) {
|
if (from) {
|
||||||
p.setPen(service
|
p.setPen(!service
|
||||||
? stm->msgServiceFg
|
? FromNameFg(context, from->id)
|
||||||
: FromNameFg(context, from->id));
|
: item->isSponsored()
|
||||||
|
? st->boxTextFgGood()
|
||||||
|
: stm->msgServiceFg);
|
||||||
return &from->nameText();
|
return &from->nameText();
|
||||||
} else if (const auto info = item->hiddenSenderInfo()) {
|
} else if (const auto info = item->hiddenSenderInfo()) {
|
||||||
p.setPen(service
|
p.setPen(!service
|
||||||
? stm->msgServiceFg
|
? FromNameFg(context, info->colorPeerId)
|
||||||
: FromNameFg(context, info->colorPeerId));
|
: item->isSponsored()
|
||||||
|
? st->boxTextFgGood()
|
||||||
|
: stm->msgServiceFg);
|
||||||
return &info->nameText;
|
return &info->nameText;
|
||||||
} else {
|
} else {
|
||||||
Unexpected("Corrupt sender information in message.");
|
Unexpected("Corrupt sender information in message.");
|
||||||
|
|
Loading…
Add table
Reference in a new issue