Removed text commands from dialogs list.

This commit is contained in:
23rd 2021-12-26 20:17:26 +03:00 committed by John Preston
parent a626364430
commit e451eb5126
3 changed files with 23 additions and 7 deletions

View File

@ -2348,8 +2348,9 @@ void InnerWidget::refreshSearchInChatLabel() {
const auto fromUserText = tr::lng_dlg_search_from(
tr::now,
lt_user,
textcmdLink(1, from));
_searchFromUserText.setText(
Ui::Text::Link(from),
Ui::Text::WithEntities);
_searchFromUserText.setMarkedText(
st::dialogsSearchFromStyle,
fromUserText,
Ui::DialogTextOptions());

View File

@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localstorage.h"
#include "ui/empty_userpic.h"
#include "ui/text/text_options.h"
#include "ui/text/text_utilities.h"
#include "ui/unread_badge.h"
#include "ui/ui_utility.h"
#include "lang/lang_keys.h"
@ -367,11 +368,25 @@ void paintRow(
if (!ShowSendActionInDialogs(history)
|| !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
if (history->cloudDraftTextCache.isEmpty()) {
auto draftWrapped = textcmdLink(1, tr::lng_dialogs_text_from_wrapped(tr::now, lt_from, tr::lng_from_draft(tr::now)));
auto draftWrapped = Ui::Text::PlainLink(
tr::lng_dialogs_text_from_wrapped(
tr::now,
lt_from,
tr::lng_from_draft(tr::now)));
auto draftText = supportMode
? textcmdLink(1, Support::ChatOccupiedString(history))
: tr::lng_dialogs_text_with_from(tr::now, lt_from_part, draftWrapped, lt_message, TextUtilities::Clean(draft->textWithTags.text));
history->cloudDraftTextCache.setText(st::dialogsTextStyle, draftText, DialogTextOptions());
? Ui::Text::PlainLink(
Support::ChatOccupiedString(history))
: tr::lng_dialogs_text_with_from(
tr::now,
lt_from_part,
draftWrapped,
lt_message,
{ .text = draft->textWithTags.text },
Ui::Text::WithEntities);
history->cloudDraftTextCache.setMarkedText(
st::dialogsTextStyle,
draftText,
DialogTextOptions());
}
p.setPen(active ? st::dialogsTextFgActive : (selected ? st::dialogsTextFgOver : st::dialogsTextFg));
if (supportMode) {

View File

@ -80,7 +80,7 @@ TextParseOptions TextNameOptions = {
};
TextParseOptions TextDialogOptions = {
TextParseRichText, // flags
TextParsePlainLinks, // flags
0, // maxw is style-dependent
1, // maxh
Qt::LayoutDirectionAuto, // lang-dependent