feat: add markdown support for user notes (#6490)
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com> Reviewed-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
committed by
GitHub
parent
a6d7918f07
commit
e084ae6ef1
@@ -36,6 +36,7 @@
|
||||
#include "widgets/helper/LiveIndicator.hpp"
|
||||
#include "widgets/helper/ScalingSpacerItem.hpp"
|
||||
#include "widgets/Label.hpp"
|
||||
#include "widgets/MarkdownLabel.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/Scrollbar.hpp"
|
||||
#include "widgets/splits/Split.hpp"
|
||||
@@ -496,7 +497,8 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
|
||||
});
|
||||
}
|
||||
|
||||
auto notesPreview = layout.emplace<Label>().assign(&ui_.notesPreview);
|
||||
auto notesPreview = layout.emplace<MarkdownLabel>(this, QString())
|
||||
.assign(&this->ui_.notesPreview);
|
||||
notesPreview->setVisible(false);
|
||||
notesPreview->setShouldElide(true);
|
||||
|
||||
@@ -1188,11 +1190,7 @@ void UserInfoPopup::updateNotes()
|
||||
return;
|
||||
}
|
||||
|
||||
static QRegularExpression spaceRegex{"\\s+"};
|
||||
|
||||
auto previewText = "Notes: " + userData->notes.replace(spaceRegex, " ");
|
||||
|
||||
this->ui_.notesPreview->setText(previewText);
|
||||
this->ui_.notesPreview->setText(userData->notes);
|
||||
this->ui_.notesPreview->setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user