replace 'markdown' (bool) property with 'markup' (str)

This commit is contained in:
MihailRis
2024-12-06 19:36:38 +03:00
parent 2f292537ad
commit 3d484383fc
8 changed files with 27 additions and 28 deletions
+5 -5
View File
@@ -82,7 +82,7 @@ glm::vec2 Label::calcSize() {
}
void Label::setText(std::wstring text) {
if (isMarkdown()) {
if (markup == "md") {
auto [processedText, styles] = markdown::process(text, true);
text = std::move(processedText);
setStyles(std::move(styles));
@@ -248,13 +248,13 @@ bool Label::isTextWrapping() const {
return textWrap;
}
void Label::setMarkdown(bool flag) {
markdown = flag;
void Label::setMarkup(std::string_view lang) {
markup = lang;
setText(text);
}
bool Label::isMarkdown() const {
return markdown;
const std::string& Label::getMarkup() const {
return markup;
}
void Label::setStyles(std::unique_ptr<FontStylesScheme> styles) {