mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed TextParseRichText.
This commit is contained in:
parent
e1aa08b985
commit
e11904e05b
14 changed files with 21 additions and 37 deletions
|
@ -28,8 +28,7 @@ namespace {
|
||||||
TextParseOptions kInformBoxTextOptions = {
|
TextParseOptions kInformBoxTextOptions = {
|
||||||
(TextParseLinks
|
(TextParseLinks
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseMarkdown
|
| TextParseMarkdown), // flags
|
||||||
| TextParseRichText), // flags
|
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
|
|
@ -108,7 +108,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
TextParseOptions MenuTextOptions = {
|
TextParseOptions MenuTextOptions = {
|
||||||
TextParseLinks | TextParseRichText, // flags
|
TextParseLinks, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
|
|
@ -1117,7 +1117,7 @@ TextForMimeData MediaLocation::clipboardText() const {
|
||||||
Ui::WebpageTextTitleOptions().flags);
|
Ui::WebpageTextTitleOptions().flags);
|
||||||
auto descriptionResult = TextUtilities::ParseEntities(
|
auto descriptionResult = TextUtilities::ParseEntities(
|
||||||
_description,
|
_description,
|
||||||
TextParseLinks | TextParseMultiline | TextParseRichText);
|
TextParseLinks | TextParseMultiline);
|
||||||
if (!titleResult.empty()) {
|
if (!titleResult.empty()) {
|
||||||
result.append(std::move(titleResult));
|
result.append(std::move(titleResult));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3019,7 +3019,7 @@ void Session::webpageApplyFields(
|
||||||
qs(data.vdescription().value_or_empty())
|
qs(data.vdescription().value_or_empty())
|
||||||
};
|
};
|
||||||
const auto siteName = qs(data.vsite_name().value_or_empty());
|
const auto siteName = qs(data.vsite_name().value_or_empty());
|
||||||
auto parseFlags = TextParseLinks | TextParseMultiline | TextParseRichText;
|
auto parseFlags = TextParseLinks | TextParseMultiline;
|
||||||
if (siteName == qstr("Twitter") || siteName == qstr("Instagram")) {
|
if (siteName == qstr("Twitter") || siteName == qstr("Instagram")) {
|
||||||
parseFlags |= TextParseHashtags | TextParseMentions;
|
parseFlags |= TextParseHashtags | TextParseMentions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,13 +174,7 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
Ui::Text::WithEntities);
|
Ui::Text::WithEntities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextParseOptions opts = {
|
text.setMarkedText(st::fwdTextStyle, phrase);
|
||||||
TextParseRichText,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
Qt::LayoutDirectionAuto
|
|
||||||
};
|
|
||||||
text.setMarkedText(st::fwdTextStyle, phrase, opts);
|
|
||||||
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
||||||
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
||||||
});
|
});
|
||||||
|
|
|
@ -72,7 +72,7 @@ QSize Game::countOptimalSize() {
|
||||||
auto text = _data->description;
|
auto text = _data->description;
|
||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
auto marked = TextWithEntities { text };
|
auto marked = TextWithEntities { text };
|
||||||
auto parseFlags = TextParseLinks | TextParseMultiline | TextParseRichText;
|
auto parseFlags = TextParseLinks | TextParseMultiline;
|
||||||
TextUtilities::ParseEntities(marked, parseFlags);
|
TextUtilities::ParseEntities(marked, parseFlags);
|
||||||
if (!_attach) {
|
if (!_attach) {
|
||||||
_description.updateSkipBlock(
|
_description.updateSkipBlock(
|
||||||
|
|
|
@ -70,7 +70,7 @@ void Invoice::fillFromData(not_null<Data::Invoice*> invoice) {
|
||||||
// init strings
|
// init strings
|
||||||
if (!invoice->description.isEmpty()) {
|
if (!invoice->description.isEmpty()) {
|
||||||
auto marked = TextWithEntities { invoice->description };
|
auto marked = TextWithEntities { invoice->description };
|
||||||
auto parseFlags = TextParseLinks | TextParseMultiline | TextParseRichText;
|
auto parseFlags = TextParseLinks | TextParseMultiline;
|
||||||
TextUtilities::ParseEntities(marked, parseFlags);
|
TextUtilities::ParseEntities(marked, parseFlags);
|
||||||
_description.setMarkedText(
|
_description.setMarkedText(
|
||||||
st::webPageDescriptionStyle,
|
st::webPageDescriptionStyle,
|
||||||
|
|
|
@ -46,7 +46,7 @@ Location::Location(
|
||||||
st::webPageDescriptionStyle,
|
st::webPageDescriptionStyle,
|
||||||
TextUtilities::ParseEntities(
|
TextUtilities::ParseEntities(
|
||||||
description,
|
description,
|
||||||
TextParseLinks | TextParseMultiline | TextParseRichText),
|
TextParseLinks | TextParseMultiline),
|
||||||
Ui::WebpageTextDescriptionOptions());
|
Ui::WebpageTextDescriptionOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace {
|
||||||
using TextState = HistoryView::TextState;
|
using TextState = HistoryView::TextState;
|
||||||
|
|
||||||
TextParseOptions _documentNameOptions = {
|
TextParseOptions _documentNameOptions = {
|
||||||
TextParseMultiline | TextParseRichText | TextParseLinks | TextParseMarkdown, // flags
|
TextParseMultiline | TextParseLinks | TextParseMarkdown, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
@ -637,8 +637,7 @@ Voice::Voice(
|
||||||
dateText,
|
dateText,
|
||||||
lt_duration,
|
lt_duration,
|
||||||
{ .text = Ui::FormatDurationText(duration()) },
|
{ .text = Ui::FormatDurationText(duration()) },
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities));
|
||||||
{ TextParseRichText, 0, 0, Qt::LayoutDirectionAuto });
|
|
||||||
_details.setLink(1, goToMessageClickHandler(parent));
|
_details.setLink(1, goToMessageClickHandler(parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ namespace {
|
||||||
TextParseOptions kInformBoxTextOptions = {
|
TextParseOptions kInformBoxTextOptions = {
|
||||||
(TextParseLinks
|
(TextParseLinks
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseMarkdown
|
| TextParseMarkdown), // flags
|
||||||
| TextParseRichText), // flags
|
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
@ -30,7 +29,6 @@ TextParseOptions kMarkedTextBoxOptions = {
|
||||||
(TextParseLinks
|
(TextParseLinks
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseMarkdown
|
| TextParseMarkdown
|
||||||
| TextParseRichText
|
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags), // flags
|
| TextParseHashtags), // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
|
|
|
@ -59,7 +59,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
TextParseOptions MenuTextOptions = {
|
TextParseOptions MenuTextOptions = {
|
||||||
TextParseLinks | TextParseRichText, // flags
|
TextParseLinks, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
|
|
@ -102,7 +102,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
TextParseOptions MenuTextOptions = {
|
TextParseOptions MenuTextOptions = {
|
||||||
TextParseLinks | TextParseRichText, // flags
|
TextParseLinks, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
|
|
@ -18,7 +18,6 @@ TextParseOptions HistoryTextOptions = {
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags
|
| TextParseHashtags
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseRichText
|
|
||||||
| TextParseMarkdown, // flags
|
| TextParseMarkdown, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
|
@ -31,7 +30,6 @@ TextParseOptions HistoryBotOptions = {
|
||||||
| TextParseHashtags
|
| TextParseHashtags
|
||||||
| TextParseBotCommands
|
| TextParseBotCommands
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseRichText
|
|
||||||
| TextParseMarkdown, // flags
|
| TextParseMarkdown, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
|
@ -41,9 +39,8 @@ TextParseOptions HistoryBotOptions = {
|
||||||
TextParseOptions HistoryServiceOptions = {
|
TextParseOptions HistoryServiceOptions = {
|
||||||
TextParseLinks
|
TextParseLinks
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags
|
|
||||||
//| TextParseMultiline
|
//| TextParseMultiline
|
||||||
| TextParseRichText, // flags
|
| TextParseHashtags, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // lang-dependent
|
Qt::LayoutDirectionAuto, // lang-dependent
|
||||||
|
@ -53,8 +50,7 @@ TextParseOptions HistoryTextNoMonoOptions = {
|
||||||
TextParseLinks
|
TextParseLinks
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags
|
| TextParseHashtags
|
||||||
| TextParseMultiline
|
| TextParseMultiline, // flags
|
||||||
| TextParseRichText, // flags
|
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
@ -65,8 +61,7 @@ TextParseOptions HistoryBotNoMonoOptions = {
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags
|
| TextParseHashtags
|
||||||
| TextParseBotCommands
|
| TextParseBotCommands
|
||||||
| TextParseMultiline
|
| TextParseMultiline, // flags
|
||||||
| TextParseRichText, // flags
|
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
@ -87,7 +82,7 @@ TextParseOptions TextDialogOptions = {
|
||||||
};
|
};
|
||||||
|
|
||||||
TextParseOptions WebpageTitleOptions = {
|
TextParseOptions WebpageTitleOptions = {
|
||||||
TextParseMultiline | TextParseRichText, // flags
|
TextParseMultiline, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
Qt::LayoutDirectionAuto, // dir
|
Qt::LayoutDirectionAuto, // dir
|
||||||
|
@ -98,7 +93,6 @@ TextParseOptions WebpageDescriptionOptions = {
|
||||||
| TextParseMentions
|
| TextParseMentions
|
||||||
| TextParseHashtags
|
| TextParseHashtags
|
||||||
| TextParseMultiline
|
| TextParseMultiline
|
||||||
| TextParseRichText
|
|
||||||
| TextParseMarkdown, // flags
|
| TextParseMarkdown, // flags
|
||||||
0, // maxw
|
0, // maxw
|
||||||
0, // maxh
|
0, // maxh
|
||||||
|
|
|
@ -820,14 +820,14 @@ void Notification::updateNotifyDisplay() {
|
||||||
lt_count,
|
lt_count,
|
||||||
_forwardedCount))
|
_forwardedCount))
|
||||||
: QString()));
|
: QString()));
|
||||||
const auto Options = TextParseOptions{
|
const auto options = TextParseOptions{
|
||||||
TextParseRichText
|
TextParsePlainLinks
|
||||||
| (_forwardedCount > 1 ? TextParseMultiline : 0),
|
| (_forwardedCount > 1 ? TextParseMultiline : 0),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
Qt::LayoutDirectionAuto,
|
Qt::LayoutDirectionAuto,
|
||||||
};
|
};
|
||||||
itemTextCache.setMarkedText(st::dialogsTextStyle, text, Options);
|
itemTextCache.setMarkedText(st::dialogsTextStyle, text, options);
|
||||||
itemTextCache.drawElided(
|
itemTextCache.drawElided(
|
||||||
p,
|
p,
|
||||||
r.left(),
|
r.left(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue