UI/Qt: Don't show URL when a new tab is initially focused

The URL is now not shown when a new tab is initially activated until
the location bar loses focus. This allows the user to see the location
bar placeholder text when opening a new tab. It also makes it easier to
paste URLs into the location bar after opening a new tab.
This commit is contained in:
Tim Ledbetter
2024-06-10 10:33:35 +01:00
committed by Andreas Kling
parent 7242fdcf23
commit 808784092c
5 changed files with 39 additions and 6 deletions

View File

@@ -648,8 +648,11 @@ Tab& BrowserWindow::create_new_tab(Web::HTML::ActivateTab activate_tab, Tab& par
}
m_tabs_container->addTab(tab, "New Tab");
if (activate_tab == Web::HTML::ActivateTab::Yes)
if (activate_tab == Web::HTML::ActivateTab::Yes) {
m_tabs_container->setCurrentWidget(tab);
if (m_tabs_container->count() != 1)
tab->set_url_is_hidden(true);
}
initialize_tab(tab);
return *tab;
}
@@ -663,8 +666,11 @@ Tab& BrowserWindow::create_new_tab(Web::HTML::ActivateTab activate_tab)
}
m_tabs_container->addTab(tab, "New Tab");
if (activate_tab == Web::HTML::ActivateTab::Yes)
if (activate_tab == Web::HTML::ActivateTab::Yes) {
m_tabs_container->setCurrentWidget(tab);
if (m_tabs_container->count() != 1)
tab->set_url_is_hidden(true);
}
initialize_tab(tab);
return *tab;