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 <QQmlEngine>
#include <QImageReader>
#include <Kirigami/Platform/PlatformTheme>
#ifndef Q_OS_ANDROID
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Repository>
@@ -101,6 +102,11 @@ public:
*/
Q_INVOKABLE void closeLinkPreview(int row);
/**
* @brief Toggle spoiler for the component at the given row.
*/
Q_INVOKABLE void toggleSpoiler(QModelIndex index);
Q_SIGNALS:
void authorChanged();
@@ -232,4 +238,8 @@ private:
QList<QUrl> m_removedLinkPreviews;
MessageComponent linkPreviewComponent(const QUrl &link);
Kirigami::Platform::PlatformTheme *m_theme = nullptr;
void updateSpoilers();
void updateSpoiler(const QModelIndex &index);
};