Commit 6bf53c87 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

kcm/kwinrules: Keep sheet open when adding properties via button

Keep properties sheet open when clicking on the button to add
a new property. This allows to add several properties in a row.
Clicking on the full row will keep the previous behavior for the
simple case, closing the sheet so the new property can be edited
right away

Also make the button on each delegate always visible (not only
on hover) to be more consistent with current status everywhere else.

Previously the sheet would remain open only after detecting some
window properties, which was a very hidden and confusing pattern.

BUG: 431228
FIXED-IN: 5.26
parent 405469aa
Pipeline #219949 failed with stage
in 14 minutes and 4 seconds
......@@ -218,8 +218,7 @@ ScrollViewKCM {
}
QQC2.ToolButton {
icon.name: (model.enabled) ? "dialog-ok-apply" : "list-add"
opacity: propertyDelegate.hovered ? 1 : 0
onClicked: propertyDelegate.clicked()
onClicked: addProperty();
Layout.preferredWidth: implicitWidth
Layout.leftMargin: -Kirigami.Units.smallSpacing
Layout.rightMargin: -Kirigami.Units.smallSpacing
......@@ -228,14 +227,16 @@ ScrollViewKCM {
}
onClicked: {
addProperty();
propertySheet.close();
}
function addProperty() {
model.enabled = true;
if (model.suggested != null) {
model.value = model.suggested;
model.suggested = null;
}
if (!overlayModel.onlySuggestions) {
propertySheet.close();
}
}
}
}
......
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