X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;h=bd62f83beaa521343768bb9355fa3922359cd1f3;hb=15219459baed09d03d17a12c72302595c135fd53;hp=ff8563c96a9b5d8b311aca160f51b3098e5ab41c;hpb=b516206c4d278640374cbfe244a5510e5ac70b54;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index ff8563c..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(); @@ -337,11 +337,12 @@ PrivacyWebEngineView* TabWidget::addTab(const bool focusNewWebEngineView) // 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. - tabWidgetPointer->setCurrentIndex(newTabIndex); + // 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.