kcms/rules: Add a placeholder for properties filter

The list to add properties can be empty because no entry matches
the filter text or if all the properties have been already added.

Show a placeholder instead of leaving the view just empty
wilder/Plasma/6.2
Ismael Asensio 2 years ago
parent 9098fd4910
commit 0bd722e84b
  1. 12
      src/kcms/rules/ui/RulesEditor.qml

@ -257,6 +257,18 @@ KCM.ScrollViewKCM {
}
}
}
Kirigami.PlaceholderMessage {
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
visible: overlayModel.count === 0
text: {
if (searchField.text.length === 0) {
return i18nc("@info:placeholder", "No properties left to add");
}
return i18nc("@info:placeholder %1 is a filter text introduced by the user", "No properties match \"%1\"", searchField.text);
}
}
}
onVisibleChanged: {

Loading…
Cancel
Save