mirror of https://github.com/procxx/kepka.git
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);
|
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);
|
||||||
|
|
Loading…
Reference in New Issue