Apply all the required styling in cpp

Apply all the required styling to show links, table, spoilers, etc in cpp. This also updates the method of revealing spoilers so now you can click to reveal then click again to hide.
This commit is contained in:
James Graham
2025-08-20 17:10:44 +01:00
parent 4498d4457b
commit 0d63fce59a
9 changed files with 297 additions and 107 deletions

View File

@@ -7,6 +7,7 @@
#include <QQuickAttachedPropertyPropagator>
#include <QQuickItem>
#include "models/messagecontentfiltermodel.h"
#include "models/messagecontentmodel.h"
#include "neochatroom.h"
@@ -32,6 +33,11 @@ class MessageAttached : public QQuickAttachedPropertyPropagator
*/
Q_PROPERTY(MessageContentModel *contentModel READ contentModel WRITE setContentModel NOTIFY contentModelChanged FINAL)
/**
* @brief The content model for the current message.
*/
Q_PROPERTY(MessageContentFilterModel *contentFilterModel READ contentFilterModel WRITE setContentFilterModel NOTIFY contentFilterModelChanged FINAL)
/**
* @brief The index of the message in the timeline
*/
@@ -66,6 +72,9 @@ public:
MessageContentModel *contentModel() const;
void setContentModel(MessageContentModel *contentModel);
MessageContentFilterModel *contentFilterModel() const;
void setContentFilterModel(MessageContentFilterModel *contentFilterModel);
int index() const;
void setIndex(int index);
@@ -82,6 +91,7 @@ Q_SIGNALS:
void roomChanged();
void timelineChanged();
void contentModelChanged();
void contentFilterModelChanged();
void indexChanged();
void maxContentWidthChanged();
void selectedTextChanged();
@@ -101,6 +111,9 @@ private:
QPointer<MessageContentModel> m_contentModel;
bool m_explicitContentModel = false;
QPointer<MessageContentFilterModel> m_contentFilterModel;
bool m_explicitContentFilterModel = false;
int m_index = -1;
bool m_explicitIndex = false;