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:
Jacob Alexander Thompson
2025-12-28 02:39:27 -08:00
committed by GitHub
parent a6d7918f07
commit e084ae6ef1
22 changed files with 640 additions and 12 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include "widgets/Label.hpp"
class QTextDocument;
namespace chatterino {
/// @brief A Label that supports rendering markdown text
///
/// MarkdownLabel inherits from Label and adds markdown rendering capabilities.
/// It automatically handles markdown document creation and rendering.
class MarkdownLabel : public Label
{
public:
explicit MarkdownLabel(BaseWidget *parent, QString text,
FontStyle style = FontStyle::UiMedium);
void setText(const QString &text);
protected:
void paintEvent(QPaintEvent * /*event*/) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
private:
void updateSize() override;
QTextDocument *markdownDocument;
};
} // namespace chatterino