┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-12-01 20:56:00 +0000
committerPeter Penz <[email protected]>2008-12-01 20:56:00 +0000
commitda5f59b3bbb7646b9a7b395363d4f6c86ad514bc (patch)
treee5bd3a0b37b051d2138d98fa296d4662a24965ab /src
parenteb6febc75f725f19198dea1a91dc7535476a8572 (diff)
* assure that the keyboard focus is in the view when switching between tabs
* assure that the URL navigator gets the focus when it is editable and a new tab is opened by File -> New Tab BUG: 174594 svn path=/trunk/KDE/kdebase/apps/; revision=891367
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 9fe681462..053390d29 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -297,6 +297,13 @@ void DolphinMainWindow::openNewTab()
{
openNewTab(m_activeViewContainer->url());
m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
+
+ KUrlNavigator* navigator = m_activeViewContainer->urlNavigator();
+ if (navigator->isUrlEditable()) {
+ // if a new tab is opened and the URL is editable, assure that
+ // the user can edit the URL without manually setting the focus
+ navigator->setFocus();
+ }
}
void DolphinMainWindow::openNewTab(const KUrl& url)
@@ -313,6 +320,7 @@ void DolphinMainWindow::openNewTab(const KUrl& url)
ViewTab viewTab;
viewTab.splitter = new QSplitter(this);
viewTab.primaryView = new DolphinViewContainer(this, viewTab.splitter, url);
+ viewTab.primaryView->setActive(false);
connectViewSignals(viewTab.primaryView);
viewTab.primaryView->view()->reload();
@@ -710,7 +718,12 @@ void DolphinMainWindow::setActiveTab(int index)
}
// hide current tab content
- m_viewTab[m_tabIndex].isPrimaryViewActive = m_viewTab[m_tabIndex].primaryView->isActive();
+ ViewTab& hiddenTab = m_viewTab[m_tabIndex];
+ hiddenTab.isPrimaryViewActive = hiddenTab.primaryView->isActive();
+ hiddenTab.primaryView->setActive(false);
+ if (hiddenTab.secondaryView != 0) {
+ hiddenTab.secondaryView->setActive(false);
+ }
QSplitter* splitter = m_viewTab[m_tabIndex].splitter;
splitter->hide();
m_centralWidgetLayout->removeWidget(splitter);