- // Update the progress bar.
- connect(privacyWebEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(privacyWebEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(loadProgress(const int)));
- connect(privacyWebEngineViewPointer, SIGNAL(loadFinished(const bool)), this, SLOT(loadFinished()));
+ // Update the status of the forward and back buttons.
+ emit updateBackAction(currentWebEngineHistoryPointer->canGoBack());
+ emit updateForwardAction(currentWebEngineHistoryPointer->canGoForward());
+ }
+
+ // Reapply the zoom factor. This is a bug in QWebEngineView that resets the zoom with every load. It can be removed once <https://redmine.stoutner.com/issues/799> is fixed.
+ privacyWebEngineViewPointer->setZoomFactor(currentZoomFactor);
+ });
+
+ // Update the progress bar when a load is started.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadStarted, [privacyWebEngineViewPointer, this] ()
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = 0;
+
+ // Show the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit showProgressBar(0);
+ });
+
+ // Update the progress bar when a load progresses.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadProgress, [privacyWebEngineViewPointer, this] (const int progress)
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = progress;
+
+ // Update the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit showProgressBar(progress);
+ });
+
+ // Update the progress bar when a load finishes.
+ connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::loadFinished, [privacyWebEngineViewPointer, this] ()
+ {
+ // Store the load progress.
+ privacyWebEngineViewPointer->loadProgressInt = -1;
+
+ // Hide the progress bar if this is the current tab.
+ if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
+ emit hideProgressBar();
+ });