X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;h=bd62f83beaa521343768bb9355fa3922359cd1f3;hb=15219459baed09d03d17a12c72302595c135fd53;hp=3a1b54f33f2028f411b5eefadb14d346f794bb13;hpb=aa9a6b20db5e2c808b390b62704f28bd649e283c;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index 3a1b54f..bd62f83 100644 --- a/src/widgets/TabWidget.cpp +++ b/src/widgets/TabWidget.cpp @@ -141,7 +141,7 @@ void TabWidget::addFirstTab() tabWidgetPointer->currentWidget()->setFocus(); } -PrivacyWebEngineView* TabWidget::addTab(const bool focusNewWebEngineView) +PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const bool backgroundTab) { // Create a privacy WebEngine view. PrivacyWebEngineView *privacyWebEngineViewPointer = new PrivacyWebEngineView(); @@ -334,11 +334,15 @@ PrivacyWebEngineView* TabWidget::addTab(const bool focusNewWebEngineView) // Set the spell check language. webEngineProfilePointer->setSpellCheckLanguages({QStringLiteral("en_US")}); - // Move to the new tab. - tabWidgetPointer->setCurrentIndex(newTabIndex); + // Populate the zoom factor. This is necessary if a URL is being loaded, like a local URL, that does not trigger `applyDomainSettings()`. + privacyWebEngineViewPointer->setZoomFactor(Settings::zoomFactor()); + + // Move to the new tab if it is not a background tab. + if (!backgroundTab) + tabWidgetPointer->setCurrentIndex(newTabIndex); // Clear the URL line edit focus so that it populates correctly when opening a new tab from the context menu. - if (focusNewWebEngineView) + if (removeUrlLineEditFocus) emit clearUrlLineEditFocus(); // Return the privacy WebEngine view pointer.