Commit 31cba55c authored by toluschr's avatar toluschr Committed by Elvis Angelaccio

Add tooltip to tabbar

parent b343fdff
...@@ -382,6 +382,7 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url) ...@@ -382,6 +382,7 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url)
const int index = indexOf(qobject_cast<QWidget*>(sender())); const int index = indexOf(qobject_cast<QWidget*>(sender()));
if (index >= 0) { if (index >= 0) {
tabBar()->setTabText(index, tabName(tabPageAt(index))); tabBar()->setTabText(index, tabName(tabPageAt(index)));
tabBar()->setTabToolTip(index, url.path());
if (tabBar()->isVisible()) { if (tabBar()->isVisible()) {
tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url))); tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url)));
} else { } else {
...@@ -417,8 +418,12 @@ void DolphinTabWidget::tabInserted(int index) ...@@ -417,8 +418,12 @@ void DolphinTabWidget::tabInserted(int index)
if (count() > 1) { if (count() > 1) {
// Resolve all pending tab icons // Resolve all pending tab icons
for (int i = 0; i < count(); ++i) { for (int i = 0; i < count(); ++i) {
const QUrl url = tabPageAt(i)->activeViewContainer()->url();
if (tabBar()->tabIcon(i).isNull()) { if (tabBar()->tabIcon(i).isNull()) {
tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(tabPageAt(i)->activeViewContainer()->url()))); tabBar()->setTabIcon(i, QIcon::fromTheme(KIO::iconNameForUrl(url)));
}
if (tabBar()->tabToolTip(i).isEmpty()) {
tabBar()->setTabToolTip(index, url.path());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment