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

@@ -29,6 +29,7 @@
#include "chatbartype.h"
#include "chatdocumenthandler_logging.h"
#include "eventhandler.h"
#include "textstyle.h"
using namespace Qt::StringLiterals;
@@ -1027,12 +1028,12 @@ int ChatDocumentHandler::currentListStyle() const
return -textCursor().currentList()->format().style();
}
ChatDocumentHandler::Style ChatDocumentHandler::style() const
TextStyle::Style ChatDocumentHandler::style() const
{
return static_cast<Style>(textCursor().blockFormat().headingLevel());
return static_cast<TextStyle::Style>(textCursor().blockFormat().headingLevel());
}
void ChatDocumentHandler::setStyle(ChatDocumentHandler::Style style)
void ChatDocumentHandler::setStyle(TextStyle::Style style)
{
const int headingLevel = style <= 6 ? style : 0;
// Apparently, 5 is maximum for FontSizeAdjustment; otherwise level=1 and