diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-05 11:06:50 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-05 11:06:50 +0200 |
| commit | 7e7ac47308d88aa3a67836937a6888b7b3d90d56 (patch) | |
| tree | 34515761fe733601485948afa17aae05057237df | |
| parent | b917b6099ab8477488f0f352339aa6fca2235c36 (diff) | |
| download | kristall-7e7ac47308d88aa3a67836937a6888b7b3d90d56.tar.gz | |
Adds option to navigate back to an older item
| -rw-r--r-- | browsertab.cpp | 7 | ||||
| -rw-r--r-- | browsertab.hpp | 2 | ||||
| -rw-r--r-- | mainwindow.cpp | 8 | ||||
| -rw-r--r-- | mainwindow.hpp | 2 |
4 files changed, 18 insertions, 1 deletions
diff --git a/browsertab.cpp b/browsertab.cpp index 357454f..005926d 100644 --- a/browsertab.cpp +++ b/browsertab.cpp @@ -85,6 +85,11 @@ void BrowserTab::navigateTo(const QUrl &url) this->updateUI(); } +void BrowserTab::navigateBack(QModelIndex history_index) +{ + qDebug() << history_index; +} + void BrowserTab::on_menu_button_clicked() { QMenu menu; @@ -166,7 +171,7 @@ void BrowserTab::on_gemini_complete(const QByteArray &data, const QString &mime) } #endif else if(mime.startsWith("text/")) { - this->ui->text_browser->setText(QString::fromUtf8(data)); + this->ui->text_browser->setPlainText(QString::fromUtf8(data)); } else if(mime.startsWith("image/")) { diff --git a/browsertab.hpp b/browsertab.hpp index d49e2fe..cd31a94 100644 --- a/browsertab.hpp +++ b/browsertab.hpp @@ -25,6 +25,8 @@ public: void navigateTo(QUrl const & url); + void navigateBack(QModelIndex history_index); + private slots: void on_menu_button_clicked(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 4936c4a..48e7f54 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -94,3 +94,11 @@ void MainWindow::on_browser_tabs_tabCloseRequested(int index) { delete this->ui->browser_tabs->widget(index); } + +void MainWindow::on_history_view_doubleClicked(const QModelIndex &index) +{ + BrowserTab * tab = qobject_cast<BrowserTab*>(this->ui->browser_tabs->currentWidget()); + if(tab != nullptr) { + tab->navigateBack(index); + } +} diff --git a/mainwindow.hpp b/mainwindow.hpp index 0481011..c55a569 100644 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -36,6 +36,8 @@ private slots: void on_browser_tabs_tabCloseRequested(int index); + void on_history_view_doubleClicked(const QModelIndex &index); + private: Ui::MainWindow *ui; |
