Skip to content

Commit

Permalink
Wrap names in LRM/RLM for correct layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 28, 2024
1 parent 675198d commit 24b0b33
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions Telegram/SourceFiles/data/data_forum_topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ TextWithEntities ForumTopicIconWithTitle(
MsgId rootId,
DocumentId iconId,
const QString &title) {
const auto wrapped = st::wrap_rtl(title);
return (rootId == ForumTopic::kGeneralId)
? TextWithEntities{ u"# "_q + title }
? TextWithEntities{ u"# "_q + wrapped }
: iconId
? Data::SingleCustomEmoji(iconId).append(' ').append(title)
: TextWithEntities{ title };
? Data::SingleCustomEmoji(iconId).append(' ').append(wrapped)
: TextWithEntities{ wrapped };
}

QString ForumGeneralIconTitle() {
Expand Down
5 changes: 3 additions & 2 deletions Telegram/SourceFiles/dialogs/ui/dialogs_message_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,13 @@ HistoryView::ItemPreview PreviewWithSender(
HistoryView::ItemPreview &&preview,
const QString &sender,
TextWithEntities topic) {
const auto wrappedSender = st::wrap_rtl(sender);
auto senderWithOffset = topic.empty()
? TextWithTagOffset<lt_from>::FromString(sender)
? TextWithTagOffset<lt_from>::FromString(wrappedSender)
: tr::lng_dialogs_text_from_in_topic(
tr::now,
lt_from,
{ sender },
{ wrappedSender },
lt_topic,
std::move(topic),
TextWithTagOffset<lt_from>::FromString);
Expand Down
7 changes: 4 additions & 3 deletions Telegram/SourceFiles/window/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ void MainWindow::updateTitle() {
const auto user = (session
&& !settings.hideAccountName
&& Core::App().domain().accountsAuthedCount() > 1)
? session->authedName()
? st::wrap_rtl(session->authedName())
: QString();
const auto key = (session && !settings.hideChatName)
? session->activeChatCurrent()
Expand All @@ -864,10 +864,11 @@ void MainWindow::updateTitle() {
: history->peer->isSelf()
? tr::lng_saved_messages(tr::now)
: history->peer->name();
const auto wrapped = st::wrap_rtl(name);
const auto threadCounter = thread->chatListBadgesState().unreadCounter;
const auto primary = (threadCounter > 0)
? u"(%1) %2"_q.arg(threadCounter).arg(name)
: name;
? u"(%1) %2"_q.arg(threadCounter).arg(wrapped)
: wrapped;
const auto middle = !user.isEmpty()
? (u" @ "_q + user)
: !added.isEmpty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ void Notification::updateNotifyDisplay() {
}

const auto topicWithChat = [&]() -> TextWithEntities {
const auto name = _history->peer->name();
const auto name = st::wrap_rtl(_history->peer->name());
return _topic
? _topic->titleWithIcon().append(u" ("_q + name + ')')
: TextWithEntities{ name };
Expand Down

0 comments on commit 24b0b33

Please sign in to comment.