X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;fp=src%2Fwidgets%2FTabWidget.cpp;h=9e843ef306da564f362d7c5e434a0589b7dda21d;hp=ba12f042d4076bc1cc0bb7e679e47f79f7c15e25;hb=8689d74c8a97cbeb81b69bed8e195ed68bca2ee1;hpb=8292f934246cb283e1b0c32f4388c674f275c7aa diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index ba12f04..9e843ef 100644 --- a/src/widgets/TabWidget.cpp +++ b/src/widgets/TabWidget.cpp @@ -141,7 +141,7 @@ void TabWidget::addFirstTab() tabWidgetPointer->currentWidget()->setFocus(); } -PrivacyWebEngineView* TabWidget::addTab() +PrivacyWebEngineView* TabWidget::addTab(const bool focusNewWebEngineView) { // Create a privacy WebEngine view. PrivacyWebEngineView *privacyWebEngineViewPointer = new PrivacyWebEngineView(); @@ -290,6 +290,10 @@ PrivacyWebEngineView* TabWidget::addTab() // Move to the new tab. 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) + emit clearUrlLineEditFocus(); + // Return the privacy WebEngine view pointer. return privacyWebEngineViewPointer; }