summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-10 19:11:54 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-10 19:11:54 +0200
commit7e0bc7dab417bd01acd50a9a95f324e5b8e1d79a (patch)
treebe1ea5e072d8eb7f393f9e4c8a1e4b25effb5a31
parentpedantic (diff)
downloadrekonq-7e0bc7dab417bd01acd50a9a95f324e5b8e1d79a.tar.xz
new tab has to have focusgit st
-rw-r--r--src/mainview.cpp15
-rw-r--r--src/mainview.h2
2 files changed, 9 insertions, 8 deletions
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();
diff --git a/src/mainview.h b/src/mainview.h
index 96417d4f..4203e272 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -99,7 +99,7 @@ protected:
public slots:
void loadUrlInCurrentTab(const KUrl &url);
- WebView *newWebView(bool makeCurrent = true);
+ WebView *newWebView();
void slotCloneTab(int index = -1);
void slotCloseTab(int index = -1);
void slotCloseOtherTabs(int index);