[kcmkwin/kwinrules] Add explanatory text to placeholder messages

This commit is contained in:
Nate Graham 2021-03-18 21:57:00 -06:00
parent ca23bca813
commit 37445d9c29
2 changed files with 15 additions and 16 deletions

View file

@ -44,25 +44,24 @@ ScrollViewKCM {
NumberAnimation { property: "y"; duration: Kirigami.Units.longDuration }
}
Kirigami.PlaceholderMessage {
id: hintArea
visible: rulesView.count <= 4
// We need to center on the free space below contentItem, not the full
// ListView. This invisible item helps make that positioning work no
// matter the window height
Item {
anchors {
// We need to center on the free space below contentItem, not the full ListView.
// Setting both top and bottom anchors (or using anchors.fill) stretches the component
// and distorts the spacing between its internal items.
// This is fine as long as we have a single item here.
horizontalCenter: parent.horizontalCenter
left: parent.left
right: parent.right
top: parent.contentItem.bottom
bottom: parent.bottom
}
width: parent.width - (units.largeSpacing * 4)
helpfulAction: QQC2.Action {
text: i18n("Add Property...")
icon.name: "list-add-symbolic"
onTriggered: {
propertySheet.open();
}
visible: rulesView.count <= 4
Kirigami.PlaceholderMessage {
id: hintArea
anchors.centerIn: parent
width: parent.width - (units.largeSpacing * 4)
text: i18n("No window properties changed")
explanation: xi18nc("@info", "Click the <interface>Add Property...</interface> button below to add some window properties that will be affected by the rule")
}
}
}
@ -87,7 +86,6 @@ ScrollViewKCM {
icon.name: checked ? "dialog-close" : "list-add-symbolic"
checkable: true
checked: propertySheet.sheetOpen
visible: !hintArea.visible || checked
onToggled: {
propertySheet.sheetOpen = checked;
}

View file

@ -59,6 +59,7 @@ ScrollViewKCM {
anchors.centerIn: parent
width: parent.width - (units.largeSpacing * 4)
text: i18n("No rules for specific windows are currently set");
explanation: xi18nc("@info", "Click the <interface>Add New...</interface> button below to add some")
}
}