mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 09:19:35 +00:00
Add Ui::Text::Italic modifier.
This commit is contained in:
parent
2a8b6f05c8
commit
3bf709d459
@ -26,6 +26,10 @@ TextWithEntities Bold(const QString &text) {
|
||||
return WithSingleEntity(text, EntityType::Bold);
|
||||
}
|
||||
|
||||
TextWithEntities Italic(const QString &text) {
|
||||
return WithSingleEntity(text, EntityType::Italic);
|
||||
}
|
||||
|
||||
TextWithEntities Link(const QString &text, const QString &url) {
|
||||
return WithSingleEntity(text, EntityType::CustomUrl, url);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ struct ToUpperType {
|
||||
|
||||
inline constexpr auto Upper = details::ToUpperType{};
|
||||
TextWithEntities Bold(const QString &text);
|
||||
TextWithEntities Italic(const QString &text);
|
||||
TextWithEntities Link(
|
||||
const QString &text,
|
||||
const QString &url = "internal:action");
|
||||
@ -40,6 +41,10 @@ inline auto ToBold() {
|
||||
return rpl::map(Bold);
|
||||
}
|
||||
|
||||
inline auto ToItalic() {
|
||||
return rpl::map(Italic);
|
||||
}
|
||||
|
||||
inline auto ToLink(const QString &url = "internal:action") {
|
||||
return rpl::map([=](const QString &text) {
|
||||
return Link(text, url);
|
||||
|
Loading…
Reference in New Issue
Block a user