aboutsummaryrefslogtreecommitdiff
path: root/src/browsertab.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-03 11:06:13 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-04 11:06:26 +0100
commitf93bc413e9325750c8d41a465090058386518cfc (patch)
tree51fc2647c171df9ad9b8039a6c454c1cd70e2035 /src/browsertab.cpp
parent7fe5c148ff4083c3938f145a53f00f643985659b (diff)
downloadkristall-f93bc413e9325750c8d41a465090058386518cfc.tar.gz
Added 'busy' cursor while current tab is loading
Diffstat (limited to 'src/browsertab.cpp')
-rw-r--r--src/browsertab.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index 687dcd8..e8b8443 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -485,6 +485,8 @@ void BrowserTab::on_requestComplete(const QByteArray &ref_data, const QString &m
this->current_stats.mime_type = mime;
this->current_stats.loading_time = this->timer.elapsed();
emit this->fileLoaded(this->current_stats);
+
+ this->updateMouseCursor(false);
}
void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime)
@@ -1263,6 +1265,8 @@ void BrowserTab::addProtocolHandler(std::unique_ptr<ProtocolHandler> &&handler)
bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions options)
{
+ this->updateMouseCursor(true);
+
this->current_server_certificate = QSslCertificate { };
this->current_handler = nullptr;
@@ -1359,6 +1363,14 @@ bool BrowserTab::startRequest(const QUrl &url, ProtocolHandler::RequestOptions o
return this->current_handler->startRequest(url.adjusted(QUrl::RemoveFragment), options);
}
+void BrowserTab::updateMouseCursor(bool waiting)
+{
+ if (waiting)
+ this->ui->text_browser->setDefaultCursor(Qt::BusyCursor);
+ else
+ this->ui->text_browser->setDefaultCursor(Qt::ArrowCursor);
+}
+
bool BrowserTab::enableClientCertificate(const CryptoIdentity &ident)
{
if (not ident.isValid())