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
@@ -178,7 +178,7 @@ const Ui::Text::String &Entry::chatListNameText() const {
if (_chatListNameVersion < version) {
_chatListNameVersion = version;
_chatListNameText.setText(
st::msgNameStyle,
st::semiboldTextStyle,
chatListName(),
Ui::NameTextOptions());
}
@@ -842,11 +842,11 @@ void InnerWidget::paintPeerSearchResult(
auto nameleft = context.st->nameLeft;
auto namewidth = context.width - nameleft - context.st->padding.right();
QRect rectForName(nameleft, context.st->nameTop, namewidth, st::msgNameFont->height);
QRect rectForName(nameleft, context.st->nameTop, namewidth, st::semiboldFont->height);
if (result->name.isEmpty()) {
result->name.setText(
st::msgNameStyle,
st::semiboldTextStyle,
peer->name(),
Ui::NameTextOptions());
}
@@ -977,9 +977,9 @@ void InnerWidget::paintSearchInFilter(
- st::dialogsCancelSearch.width;
auto rectForName = QRect(
nameleft,
top + (st::dialogsSearchInHeight - st::msgNameFont->height) / 2,
top + (st::dialogsSearchInHeight - st::semiboldFont->height) / 2,
namewidth,
st::msgNameFont->height);
st::semiboldFont->height);
if (icon) {
icon->paint(p, rectForName.topLeft(), width());
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip);
@@ -2540,7 +2540,7 @@ void InnerWidget::refreshSearchInChatLabel() {
}();
if (!dialog.isEmpty()) {
_searchInChatText.setText(
st::msgNameStyle,
st::semiboldTextStyle,
dialog,
Ui::DialogTextOptions());
}
+4 -1
View File
@@ -352,7 +352,10 @@ const Ui::Text::String &FakeRow::name() const {
? _item->displayFrom()
: nullptr;
const auto peer = from ? from : _item->history()->peer.get();
_name.setText(st::msgNameStyle, peer->name(), Ui::NameTextOptions());
_name.setText(
st::semiboldTextStyle,
peer->name(),
Ui::NameTextOptions());
}
return _name;
}
@@ -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);
}