Improve the style picker

This commit is contained in:
James Graham
2025-10-27 18:10:13 +00:00
parent c128450cf5
commit 11bf741554
11 changed files with 369 additions and 98 deletions

View File

@@ -12,6 +12,7 @@
#include "chatbarcache.h"
#include "enums/chatbartype.h"
#include "enums/textstyle.h"
#include "models/completionmodel.h"
#include "neochatroom.h"
#include "nestedlisthelper_p.h"
@@ -110,7 +111,7 @@ class ChatDocumentHandler : public QObject
Q_PROPERTY(bool underline READ underline WRITE setUnderline NOTIFY formatChanged)
Q_PROPERTY(bool strikethrough READ strikethrough WRITE setStrikethrough NOTIFY formatChanged)
Q_PROPERTY(ChatDocumentHandler::Style style READ style WRITE setStyle NOTIFY styleChanged)
Q_PROPERTY(TextStyle::Style style READ style WRITE setStyle NOTIFY styleChanged)
// Q_PROPERTY(bool canIndentList READ canIndentList NOTIFY cursorPositionChanged)
// Q_PROPERTY(bool canDedentList READ canDedentList NOTIFY cursorPositionChanged)
@@ -132,25 +133,6 @@ public:
End,
};
/**
* @brief Enum to define available styles.
*
* @note The Paragraph and Heading values are intentially fixed to match heading
* level values returned by QTextBlockFormat::headingLevel().
*
* @sa QTextBlockFormat::headingLevel()
*/
enum Style {
Paragraph = 0,
Heading1 = 1,
Heading2 = 2,
Heading3 = 3,
Heading4 = 4,
Heading5 = 5,
Heading6 = 6,
};
Q_ENUM(Style);
explicit ChatDocumentHandler(QObject *parent = nullptr);
ChatBarType::Type type() const;
@@ -218,8 +200,8 @@ public:
bool canDedentList() const;
int currentListStyle() const;
Style style() const;
void setStyle(Style style);
TextStyle::Style style() const;
void setStyle(TextStyle::Style style);
// bool list() const;
// void setList(bool list);