Verified Commit 7f936de1 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Allow runners to display multiline display text

CCBUG: 395376

Counterpart of frameworks/krunner!65
parent bfa1ee49
......@@ -192,8 +192,8 @@ MouseArea {
height: undefined
elide: Text.ElideMiddle
wrapMode: Text.NoWrap
maximumLineCount: 1
wrapMode: model.multiLine ? Text.WordWrap : Text.NoWrap
maximumLineCount: model.multiLine ? Infinity : 1
verticalAlignment: Text.AlignVCenter
textFormat: Text.PlainText
......
......@@ -419,6 +419,7 @@ QHash<int, QByteArray> ResultsModel::roleNames() const
names[SubtextRole] = QByteArrayLiteral("subtext");
names[DuplicateRole] = QByteArrayLiteral("isDuplicate");
names[ActionsRole] = QByteArrayLiteral("actions");
names[MultiLineRole] = QByteArrayLiteral("multiLine");
return names;
}
......
......@@ -65,6 +65,7 @@ public:
SubtextRole,
DuplicateRole,
ActionsRole,
MultiLineRole,
};
Q_ENUM(Roles)
......
......@@ -300,6 +300,8 @@ QVariant RunnerResultsModel::data(const QModelIndex &index, int role) const
return match.matchCategory();
case ResultsModel::SubtextRole:
return match.subtext();
case ResultsModel::MultiLineRole:
return match.isMultiLine();
case ResultsModel::ActionsRole: {
const auto actions = m_manager->actionsForMatch(match);
if (actions.isEmpty()) {
......
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