Commit 87c20288 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Better window title display

Replace HTML list by simple unicode bullets, avoids awkward indentation.
Also, when there's only one window associated with a process, don't turn it into a list at all.

Differential Revision: https://phabricator.kde.org/D18779
parent f5dcd02c
......@@ -1626,15 +1626,21 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
}
case HeadingXTitle: {
#if HAVE_X11
const auto values = d->mPidToWindowInfo.values(process->pid());
if (values.count() == 1) {
return values.first()->name;
}
QString tooltip;
QList<WindowInfo *> values = d->mPidToWindowInfo.values(process->pid());
if(values.isEmpty()) return QVariant(QVariant::String);
for(int i = 0; i < values.size(); i++) {
if(!values.at(i)->name.isEmpty())
tooltip += QStringLiteral("<li>") + values.at(i)->name + QStringLiteral("</li>");
for (const auto &value : values) {
if (!tooltip.isEmpty()) {
tooltip += QLatin1Char('\n');
}
tooltip += QStringLiteral("• ") + value->name;
}
if(!tooltip.isEmpty())
return QString(QStringLiteral("<qt><p style='white-space:pre'><ul>") + tooltip + QStringLiteral("</ul>"));
return tooltip;
#endif
return QVariant(QVariant::String);
}
......
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