Commit 473b1f07 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[app] Improve plugin config delegates

Add description and make them more consistent with other list items in
KDE.
parent 753b1a2b
Pipeline #41222 canceled with stage
......@@ -25,11 +25,34 @@ Kirigami.ScrollablePage
delegate: Kirigami.SwipeListItem {
CheckBox {
checked: isChecked
text: name
onClicked: {
isChecked = checked
RowLayout {
CheckBox {
id: serviceCheck
Layout.alignment: Qt.AlignVCenter
checked: model.isChecked
onToggled: model.isChecked = checked
}
ColumnLayout {
spacing: 0
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
Label {
Layout.fillWidth: true
text: model.name
color: listItem.pressed ? listItem.activeTextColor : listItem.textColor
elide: Text.ElideRight
}
Label {
Layout.fillWidth: true
text: model.description
color: listItem.pressed ? listItem.activeTextColor : listItem.textColor
elide: Text.ElideRight
font: Kirigami.Theme.smallFont
opacity: 0.7
}
}
}
......
......@@ -68,6 +68,8 @@ QVariant PluginModel::data(const QModelIndex &index, int role) const
return QUrl::fromLocalFile(configFile);
}
case DescriptionRole:
return pluginEntry.description();
default:
return QVariant();
}
......@@ -82,6 +84,7 @@ QHash<int, QByteArray> PluginModel::roleNames() const
roles[IconRole] = "iconName";
roles[IdRole] = "pluginId";
roles[ConfigSourceRole] = "configSource";
roles[DescriptionRole] = "description";
return roles;
}
......
......@@ -25,7 +25,8 @@ public:
enum ExtraRoles {
IconRole = Qt::UserRole + 1,
IdRole,
ConfigSourceRole
ConfigSourceRole,
DescriptionRole,
};
Q_ENUM(ExtraRoles)
......
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