Add tooltip with filename to document tabs

Add the filename as tooltip. This is convenient when multiple
files are open and most of the tab labels are elided.
remotes/origin/work/devicepixelratio
Boris Petrov 4 years ago committed by Albert Astals Cid
parent 8aa96484da
commit 32bbf3d4b8
  1. 3
      shell/shell.cpp

@ -315,6 +315,8 @@ void Shell::openUrl(const QUrl &url, const QString &serializedOptions)
}
} else {
m_tabWidget->setTabText(activeTab, url.fileName());
m_tabWidget->setTabToolTip(activeTab, url.fileName());
applyOptionsToPart(activePart, serializedOptions);
bool openOk = activePart->openUrl(url);
const bool isstdin = url.fileName() == QLatin1String("-") || url.scheme() == QLatin1String("fd");
@ -754,6 +756,7 @@ void Shell::openNewTab(const QUrl &url, const QString &serializedOptions)
// Update GUI
KParts::ReadWritePart *const part = m_tabs[newIndex].part;
m_tabWidget->addTab(part->widget(), url.fileName());
m_tabWidget->setTabToolTip(newIndex, url.fileName());
applyOptionsToPart(part, serializedOptions);

Loading…
Cancel
Save