mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +00:00
Add Ui::Text::Italic modifier.
This commit is contained in:
@@ -26,6 +26,10 @@ TextWithEntities Bold(const QString &text) {
|
|||||||
return WithSingleEntity(text, EntityType::Bold);
|
return WithSingleEntity(text, EntityType::Bold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextWithEntities Italic(const QString &text) {
|
||||||
|
return WithSingleEntity(text, EntityType::Italic);
|
||||||
|
}
|
||||||
|
|
||||||
TextWithEntities Link(const QString &text, const QString &url) {
|
TextWithEntities Link(const QString &text, const QString &url) {
|
||||||
return WithSingleEntity(text, EntityType::CustomUrl, url);
|
return WithSingleEntity(text, EntityType::CustomUrl, url);
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ struct ToUpperType {
|
|||||||
|
|
||||||
inline constexpr auto Upper = details::ToUpperType{};
|
inline constexpr auto Upper = details::ToUpperType{};
|
||||||
TextWithEntities Bold(const QString &text);
|
TextWithEntities Bold(const QString &text);
|
||||||
|
TextWithEntities Italic(const QString &text);
|
||||||
TextWithEntities Link(
|
TextWithEntities Link(
|
||||||
const QString &text,
|
const QString &text,
|
||||||
const QString &url = "internal:action");
|
const QString &url = "internal:action");
|
||||||
@@ -40,6 +41,10 @@ inline auto ToBold() {
|
|||||||
return rpl::map(Bold);
|
return rpl::map(Bold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline auto ToItalic() {
|
||||||
|
return rpl::map(Italic);
|
||||||
|
}
|
||||||
|
|
||||||
inline auto ToLink(const QString &url = "internal:action") {
|
inline auto ToLink(const QString &url = "internal:action") {
|
||||||
return rpl::map([=](const QString &text) {
|
return rpl::map([=](const QString &text) {
|
||||||
return Link(text, url);
|
return Link(text, url);
|
||||||
|
Reference in New Issue
Block a user