diff options
| author | tolu schr <[email protected]> | 2020-07-08 10:59:11 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-10-13 17:44:32 +0000 |
| commit | 31cba55cff36d1d1501350209482f25a429c0a27 (patch) | |
| tree | 46cd6161d14fda114c3a6a4a0ff22374a384589b /src/dolphintabwidget.cpp | |
| parent | b343fdffc52ff42d83afa02f6eaf1f5a359a49a9 (diff) | |
Add tooltip to tabbar
Diffstat (limited to 'src/dolphintabwidget.cpp')
| -rw-r--r-- | src/dolphintabwidget.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index cd023beb2..7a14f7ca4 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -382,6 +382,7 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url) const int index = indexOf(qobject_cast<QWidget*>(sender())); if (index >= 0) { tabBar()->setTabText(index, tabName(tabPageAt(index))); + tabBar()->setTabToolTip(index, url.path()); if (tabBar()->isVisible()) { tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url))); } else { @@ -417,8 +418,12 @@ void DolphinTabWidget::tabInserted(int index) if (count() > 1) { // Resolve all pending tab icons for (int i = 0; i < count(); ++i) { + const QUrl url = tabPageAt(i)->activeViewContainer()->url(); 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()); } } |
