From f93bc413e9325750c8d41a465090058386518cfc Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Sun, 3 Jan 2021 11:06:13 +1100 Subject: Added 'busy' cursor while current tab is loading --- src/browsertab.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/browsertab.cpp') 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 &&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()) -- cgit v1.2.3