| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef HELPSPOILER_H |
| 4 | #define HELPSPOILER_H |
| 5 | |
| 6 | #include <QWidget> |
| 7 | |
| 8 | class QTextBrowser; |
| 9 | class QGridLayout; |
| 10 | class QToolButton; |
| 11 | class QParallelAnimationGroup; |
| 12 | class QScrollArea; |
| 13 | class PlainToolButton; |
| 14 | |
| 15 | class RSSGUARD_DLLSPEC HelpSpoiler : public QWidget { |
| 16 | Q_OBJECT |
| 17 | |
| 18 | public: |
| 19 | explicit HelpSpoiler(QWidget* parent = nullptr); |
| 20 | |
| 21 | void setHelpText(const QString& title, const QString& text, bool is_warning, bool force_html = false); |
| 22 | void setHelpText(const QString& text, bool is_warning, bool force_html = false); |
| 23 | |
| 24 | private slots: |
| 25 | void onAnchorClicked(const QUrl& url); |
| 26 | |
| 27 | private: |
| 28 | QToolButton* m_btnToggle; |
| 29 | QScrollArea* m_content; |
| 30 | QParallelAnimationGroup* m_animation; |
| 31 | QGridLayout* m_layout; |
| 32 | QTextBrowser* m_text; |
| 33 | PlainToolButton* m_btnHelp; |
| 34 | }; |
| 35 | |
| 36 | #endif // HELPSPOILER_H |