]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/widgets/TabWidget.cpp
Add a default zoom action. https://redmine.stoutner.com/issues/1044
[PrivacyBrowserPC.git] / src / widgets / TabWidget.cpp
index 2b14018ca6b419a8eb5dec608e66ca83024f43eb..dd11a6776c0f0fdc798fe4492879ff2ce5a84a08 100644 (file)
@@ -344,12 +344,12 @@ PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const
         }
     });
 
-    // Update the zoom factor when changed by CTRL-Scrolling.  This can be modified when <https://redmine.stoutner.com/issues/845> is fixed.
+    // Update the zoom actions when changed by CTRL-Scrolling.  This can be modified when <https://redmine.stoutner.com/issues/845> is fixed.
     connect(webEnginePagePointer, &QWebEnginePage::contentsSizeChanged, [webEnginePagePointer, this] ()
     {
-        // Only update the zoom factor action text if this is the current tab.
+        // Only update the zoom actions if this is the current tab.
         if (webEnginePagePointer == currentWebEnginePagePointer)
-            emit updateZoomFactorAction(webEnginePagePointer->zoomFactor());
+            emit updateZoomActions(webEnginePagePointer->zoomFactor());
     });
 
     // Display find text results.
@@ -1071,12 +1071,13 @@ void TabWidget::updateUiFromWebEngineView(const PrivacyWebEngineView *privacyWeb
     if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer)
     {
         // Update the UI.
+        emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor);
         emit updateDomainSettingsIndicator(currentPrivacyWebEngineViewPointer->domainSettingsName != QLatin1String(""));
         emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
         emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled);
         emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
         emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true);
-        emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor());
+        emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor());
     }
 }
 
@@ -1094,6 +1095,7 @@ void TabWidget::updateUiWithTabSettings()
     emit clearUrlLineEditFocus();
 
     // Update the actions.
+    emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor);
     emit updateBackAction(currentWebEngineHistoryPointer->canGoBack());
     emit updateCookiesAction(currentPrivacyWebEngineViewPointer->cookieListPointer->size());
     emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
@@ -1101,7 +1103,7 @@ void TabWidget::updateUiWithTabSettings()
     emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
     emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled);
     emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true);
-    emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor());
+    emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor());
 
     // Update the URL.
     emit updateWindowTitle(currentPrivacyWebEngineViewPointer->title());