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

Move some chat styles from basic.style to chat.style.

This commit is contained in:
John Preston
2022-09-30 11:25:02 +04:00
parent ba2f92906b
commit b13471672d
25 changed files with 196 additions and 37 deletions

View File

@@ -70,7 +70,7 @@ void PaintRowTopRight(
: st::dialogsDateFg);
p.drawText(
rectForName.left() + rectForName.width() + st::dialogsDateSkip,
rectForName.top() + st::msgNameFont->height - st::msgDateFont->descent,
rectForName.top() + st::semiboldFont->height - st::normalFont->descent,
text);
}
@@ -392,7 +392,7 @@ void PaintRow(
nameleft,
context.st->nameTop,
namewidth,
st::msgNameFont->height);
st::semiboldFont->height);
const auto promoted = (history && history->useTopPromotion())
&& !context.search;
@@ -612,14 +612,14 @@ void PaintRow(
sendStateIcon->paint(p, rectForName.topLeft() + QPoint(rectForName.width(), 0), context.width);
}
p.setFont(st::msgNameFont);
p.setFont(st::semiboldFont);
if (flags & (Flag::SavedMessages | Flag::RepliesMessages)) {
auto text = (flags & Flag::SavedMessages)
? tr::lng_saved_messages(tr::now)
: tr::lng_replies_messages(tr::now);
const auto textWidth = st::msgNameFont->width(text);
const auto textWidth = st::semiboldFont->width(text);
if (textWidth > rectForName.width()) {
text = st::msgNameFont->elided(text, rectForName.width());
text = st::semiboldFont->elided(text, rectForName.width());
}
p.setPen(context.active
? st::dialogsNameFgActive
@@ -687,9 +687,9 @@ void PaintRow(
? st::dialogsArchiveFgOver
: st::dialogsArchiveFg);
auto text = entry->chatListName(); // TODO feed name with emoji
auto textWidth = st::msgNameFont->width(text);
auto textWidth = st::semiboldFont->width(text);
if (textWidth > rectForName.width()) {
text = st::msgNameFont->elided(text, rectForName.width());
text = st::semiboldFont->elided(text, rectForName.width());
}
p.drawTextLeft(rectForName.left(), rectForName.top(), context.width, text);
}