diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-06 14:22:53 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-06 14:22:53 +0200 |
| commit | bcda97a2e17f6e1366cfe5b03bd0b407d4484255 (patch) | |
| tree | 2f485e8ff94e26a4c8e1b2e0310c396dbb23c5a0 /browsertab.hpp | |
| parent | 7e7ac47308d88aa3a67836937a6888b7b3d90d56 (diff) | |
| download | kristall-bcda97a2e17f6e1366cfe5b03bd0b407d4484255.tar.gz | |
Reworks document rendering: Now generates QTextDocument directly instead of using HTML inbetween.
Diffstat (limited to 'browsertab.hpp')
| -rw-r--r-- | browsertab.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/browsertab.hpp b/browsertab.hpp index cd31a94..3ef355e 100644 --- a/browsertab.hpp +++ b/browsertab.hpp @@ -4,6 +4,7 @@ #include <QWidget> #include <QUrl> #include <QGraphicsScene> +#include <QTextDocument> #include "geminiclient.hpp" #include "documentoutlinemodel.hpp" @@ -27,19 +28,15 @@ public: void navigateBack(QModelIndex history_index); +signals: + void titleChanged(QString const & title); + void locationChanged(QUrl const & url); + private slots: void on_menu_button_clicked(); void on_url_bar_returnPressed(); - void on_content_titleChanged(const QString &title); - - void on_content_loadStarted(); - - void on_content_loadFinished(bool arg1); - - void on_content_urlChanged(const QUrl &arg1); - void on_refresh_button_clicked(); void on_gemini_complete(QByteArray const & data, QString const & mime); @@ -75,6 +72,10 @@ private slots: void on_text_browser_highlighted(const QUrl &arg1); + void on_back_button_clicked(); + + void on_forward_button_clicked(); + private: void setErrorMessage(QString const & msg); @@ -82,7 +83,7 @@ private: void updateUI(); - static QByteArray translateGeminiToHtml(QByteArray const & input, DocumentOutlineModel & outline); + static std::unique_ptr<QTextDocument> translateGemini(QByteArray const & input, QUrl const & root_url, DocumentOutlineModel & outline); public: Ui::BrowserTab *ui; @@ -97,6 +98,8 @@ public: DocumentOutlineModel outline; QGraphicsScene graphics_scene; TabBrowsingHistory history; + + std::unique_ptr<QTextDocument> current_document; }; #endif // BROWSERTAB_HPP |
