Commit 010dd94c authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Christoph Cullmann
Browse files

[Tabbar] Show tooltips for untitled documents

It also makes sense to show tooltips for untitled documents, since the text on shrunken tabs isn't always readable.
parent 59e0bc31
Pipeline #222645 passed with stage
in 5 minutes and 30 seconds
......@@ -295,7 +295,7 @@ void KateTabBar::setTabDocument(int idx, KTextEditor::Document *doc)
QString tabName = doc->documentName();
tabName.replace(QLatin1Char('&'), QLatin1String("&&"));
setTabText(idx, tabName);
setTabToolTip(idx, doc->url().toDisplayString());
setTabToolTip(idx, doc->url().isValid() ? doc->url().toDisplayString(QUrl::PreferLocalFile) : doc->documentName());
setModifiedStateIcon(idx, doc);
......@@ -697,7 +697,7 @@ void KateViewSpace::updateDocumentUrl(KTextEditor::Document *doc)
// update tab button if available, might not be the case for tab limit set!
const int buttonId = m_tabBar->documentIdx(doc);
if (buttonId >= 0) {
m_tabBar->setTabToolTip(buttonId, doc->url().toDisplayString());
m_tabBar->setTabToolTip(buttonId, doc->url().toDisplayString(QUrl::PreferLocalFile));
m_tabBar->setModifiedStateIcon(buttonId, doc);
Supports Markdown
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