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:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user