From 7e0bc7dab417bd01acd50a9a95f324e5b8e1d79a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 10 Apr 2009 19:11:54 +0200 Subject: new tab has to have focusgit st --- src/mainview.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 2ada96e0..eb2ae732 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -342,7 +342,7 @@ int MainView::webViewIndex(WebView *webView) const } -WebView *MainView::newWebView(bool makeCurrent) +WebView *MainView::newWebView() { // line edit UrlBar *urlLineEdit = new UrlBar; @@ -399,14 +399,15 @@ WebView *MainView::newWebView(bool makeCurrent) connect(webView, SIGNAL(shiftCtrlTabPressed()), this, SLOT(previousTab())); addTab(webView, i18n("(Untitled)")); - if (makeCurrent) - { - setCurrentWidget(webView); - currentLineEdit()->setFocus(Qt::ActiveWindowFocusReason); - } + setCurrentWidget(webView); + + // FIXME: focus on currentLineEdit just for empty pages + currentLineEdit()->setFocus(Qt::ActiveWindowFocusReason); if (count() == 1) + { currentChanged(currentIndex()); + } emit tabsChanged(); showTabBar(); @@ -486,7 +487,7 @@ void MainView::slotCloneTab(int index) index = currentIndex(); if (index < 0 || index >= count()) return; - WebView *tab = newWebView(false); + WebView *tab = newWebView(); tab->setUrl(webView(index)->url()); showTabBar(); -- cgit v1.2.1