┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShaun Reich <[email protected]>2009-03-09 19:50:32 +0000
committerShaun Reich <[email protected]>2009-03-09 19:50:32 +0000
commit0945eb5bc2878882adbd90c99e44d2cc40fbcddf (patch)
tree9ed910de06e7268cb09532e2cb26ba91877748f2 /src
parentabfa3fff9d899ffd5b0c2ced055f12bcf5bfa6d0 (diff)
Added a few things to the "Recently Closed Tabs" menu:
* Paths now ellide when they get too big. That is, according to the font size, not character length. * Added automatic mnemomics (or however you spell that crazy word) to the menu's items. svn path=/trunk/KDE/kdebase/apps/; revision=937504
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index aa72a2b9b..c0910e274 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -85,6 +85,7 @@
#include <QLineEdit>
#include <QSplitter>
#include <QDockWidget>
+#include <kacceleratormanager.h>
/*
* Remembers the tab configuration if a tab has been closed.
@@ -1326,7 +1327,10 @@ void DolphinMainWindow::rememberClosedTab(int index)
const QString primaryPath = m_viewTab[index].primaryView->url().path();
const QString iconName = KMimeType::iconNameForUrl(primaryPath);
- QAction* action = new QAction(primaryPath, tabsMenu);
+ const QFontMetrics fm = fontMetrics();
+ const QString actionText = fm.elidedText(primaryPath, Qt::ElideMiddle, fm.maxWidth() * 20);
+
+ QAction* action = new QAction(actionText, tabsMenu);
ClosedTab closedTab;
closedTab.primaryUrl = m_viewTab[index].primaryView->url();
@@ -1354,6 +1358,7 @@ void DolphinMainWindow::rememberClosedTab(int index)
tabsMenu->removeAction(tabsMenu->actions().last());
}
actionCollection()->action("closed_tabs")->setEnabled(true);
+ KAcceleratorManager::manage(tabsMenu);
}
void DolphinMainWindow::clearStatusBar()