mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
replace 'markdown' (bool) property with 'markup' (str)
This commit is contained in:
parent
2f292537ad
commit
3d484383fc
8 changed files with 27 additions and 28 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue