diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-05 10:44:38 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-05 10:44:38 +0200 |
| commit | b917b6099ab8477488f0f352339aa6fca2235c36 (patch) | |
| tree | 1a29332613259a097dbbff2aa5fa78cdc05ab11d /browsertab.cpp | |
| parent | da305e17be24b9db1c2014c6125399147ec404d9 (diff) | |
| download | kristall-b917b6099ab8477488f0f352339aa6fca2235c36.tar.gz | |
Starts to implement navigation history.
Diffstat (limited to 'browsertab.cpp')
| -rw-r--r-- | browsertab.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/browsertab.cpp b/browsertab.cpp index d7c974b..357454f 100644 --- a/browsertab.cpp +++ b/browsertab.cpp @@ -180,7 +180,6 @@ void BrowserTab::on_gemini_complete(const QByteArray &data, const QString &mime) auto * item = this->graphics_scene.addText("Failed to load picture!"); } - this->ui->graphics_browser->fitInView(graphics_scene.sceneRect(), Qt::KeepAspectRatio); } @@ -189,6 +188,8 @@ void BrowserTab::on_gemini_complete(const QByteArray &data, const QString &mime) this->ui->text_browser->setText(QString("Unsupported Mime: %1").arg(mime)); } + this->pushToHistory(this->current_location); + this->successfully_loaded = true; this->updateUI(); } @@ -330,7 +331,7 @@ void BrowserTab::setErrorMessage(const QString &msg) void BrowserTab::pushToHistory(const QUrl &url) { - this->navigation_history.append(url); + this->history.pushUrl(url); this->updateUI(); } @@ -382,8 +383,8 @@ void BrowserTab::on_text_browser_highlighted(const QUrl &url) void BrowserTab::updateUI() { - // this->ui->back_button->setEnabled(this->navigation_history.size() > 0); - // this->ui->forward_button->setEnabled(false); + this->ui->back_button->setEnabled(this->history.canGoBack()); + this->ui->forward_button->setEnabled(this->history.canGoForward()); this->ui->refresh_button->setEnabled(this->successfully_loaded); |
