Skip to content

Commit

Permalink
feat: add a placeholder for properties filter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ismailof authored and romangg committed Sep 23, 2024
1 parent bc5df0b commit 301bc23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kcms/rules/ui/RulesEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 301bc23

Please sign in to comment.