aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/kristalltextbrowser.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-06 19:54:27 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-06 10:51:18 +0100
commit1f400782f7aa999fdd81bf25b315eb24c28530ff (patch)
treef12dedafbd5b0c92e55852c5496903a224b90748 /src/widgets/kristalltextbrowser.cpp
parent2a9bb4fa6121de62d9e6ba06d9a109ba6d57f14c (diff)
downloadkristall-1f400782f7aa999fdd81bf25b315eb24c28530ff.tar.gz
Fix busy cursor bugs
fixes A: busy cursor not resetting when changing workspaces. and B: busy cursor not resetting after page finishes loading, and cursor is left stationary.
Diffstat (limited to 'src/widgets/kristalltextbrowser.cpp')
-rw-r--r--src/widgets/kristalltextbrowser.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/widgets/kristalltextbrowser.cpp b/src/widgets/kristalltextbrowser.cpp
index b92bf0f..8f5b86a 100644
--- a/src/widgets/kristalltextbrowser.cpp
+++ b/src/widgets/kristalltextbrowser.cpp
@@ -28,10 +28,32 @@ void KristallTextBrowser::mouseReleaseEvent(QMouseEvent *event)
}
}
+void KristallTextBrowser::on_anchorClicked(const QUrl &url)
+{
+ emit this->anchorClicked(url, this->signal_new_tab);
+}
+
+
void KristallTextBrowser::mouseMoveEvent(QMouseEvent *event)
{
QTextBrowser::mouseMoveEvent(event);
+ this->updateCursor();
+}
+
+void KristallTextBrowser::setDefaultCursor(const QCursor &cur)
+{
+ this->wanted_cursor = cur;
+ this->updateCursor();
+}
+
+void KristallTextBrowser::focusInEvent(QFocusEvent *event)
+{
+ QTextBrowser::focusInEvent(event);
+ this->updateCursor();
+}
+void KristallTextBrowser::updateCursor()
+{
// This slight hack allows us to set the "default" cursor,
// (i.e when not hovering over links) We need to do this
// because QTextBrowser for some reason resets viewport cursor
@@ -43,13 +65,3 @@ void KristallTextBrowser::mouseMoveEvent(QMouseEvent *event)
this->viewport()->setCursor(wanted_cursor);
}
}
-
-void KristallTextBrowser::on_anchorClicked(const QUrl &url)
-{
- emit this->anchorClicked(url, this->signal_new_tab);
-}
-
-void KristallTextBrowser::setDefaultCursor(const QCursor &cur)
-{
- this->wanted_cursor = cur;
-}