1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Focus locationbar on startup if url of current tab is empty

This commit is contained in:
David Rosca 2016-01-27 13:23:28 +01:00
parent 6c30379077
commit 06b2414d80

View File

@ -226,7 +226,16 @@ void BrowserWindow::postLaunch()
raise(); raise();
activateWindow(); activateWindow();
QTimer::singleShot(0, tabWidget()->tabBar(), SLOT(ensureVisible())); QTimer::singleShot(0, this, [this]() {
// Scroll to current tab
tabWidget()->tabBar()->ensureVisible();
// Update focus
if (locationBar()->text().isEmpty())
locationBar()->setFocus();
else
weView()->setFocus();
});
} }
void BrowserWindow::setupUi() void BrowserWindow::setupUi()