Delete rules from the list, effect rows without the gear

A trash button on every rule line (asks first). An effect row opens on
click everywhere, with the pointer showing, so the gear is gone.
This commit is contained in:
2026-09-08 17:29:42 +01:00
parent e5053de6a7
commit 26f8c8cb9f
+29 -19
View File
@@ -395,7 +395,7 @@ Panel {
Text { Text {
anchors.left: nameText.right anchors.left: nameText.right
anchors.leftMargin: Style.space(10) anchors.leftMargin: Style.space(10)
anchors.right: chevron.left anchors.right: deleteButton.left
anchors.rightMargin: Style.space(8) anchors.rightMargin: Style.space(8)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: root.ruleSummary(line.rule, line.ruleIndex) text: root.ruleSummary(line.rule, line.ruleIndex)
@@ -419,10 +419,28 @@ Panel {
id: lineArea id: lineArea
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: onSwitch.width + Style.space(6) anchors.leftMargin: onSwitch.width + Style.space(6)
z: 1
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: root.openRule(line.ruleIndex) onClicked: root.openRule(line.ruleIndex)
} }
PanelActionButton {
id: deleteButton
z: 2
anchors.right: chevron.left
anchors.rightMargin: Style.space(4)
anchors.verticalCenter: parent.verticalCenter
iconText: "󰆴"
tooltipText: "Delete this rule"
focusable: true
foreground: root.fg
hoverColor: Color.urgent
fontFamily: root.fontFamily
opacity: lineArea.containsMouse || hovered ? 1 : 0.55
property bool hovered: false
onHovered: function(on) { hovered = on }
onClicked: root.confirmDeleteIndex = line.ruleIndex
}
} }
// ======================= page 2: one rule ======================= // ======================= page 2: one rule =======================
@@ -1050,13 +1068,6 @@ Panel {
return parts.join(" · ") return parts.join(" · ")
} }
MouseArea {
id: lineArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.openEffect(line.type)
}
Text { Text {
id: lineIcon id: lineIcon
anchors.left: parent.left anchors.left: parent.left
@@ -1082,7 +1093,7 @@ Panel {
Text { Text {
anchors.left: lineName.right anchors.left: lineName.right
anchors.leftMargin: Style.space(10) anchors.leftMargin: Style.space(10)
anchors.right: openButton.left anchors.right: removeButton.left
anchors.rightMargin: Style.space(6) anchors.rightMargin: Style.space(6)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: line.summary() text: line.summary()
@@ -1091,20 +1102,19 @@ Panel {
font.pixelSize: Style.font.bodySmall font.pixelSize: Style.font.bodySmall
elide: Text.ElideRight elide: Text.ElideRight
} }
PanelActionButton { // The whole row opens the effect; above the texts so the pointer shows
id: openButton // everywhere on it, below the remove button so that still wins.
anchors.right: removeButton.left MouseArea {
anchors.rightMargin: Style.space(2) id: lineArea
anchors.verticalCenter: parent.verticalCenter anchors.fill: parent
iconText: "󰒓" z: 1
tooltipText: "Set up" hoverEnabled: true
focusable: true cursorShape: Qt.PointingHandCursor
foreground: root.fg
fontFamily: root.fontFamily
onClicked: root.openEffect(line.type) onClicked: root.openEffect(line.type)
} }
PanelActionButton { PanelActionButton {
id: removeButton id: removeButton
z: 2
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Style.space(4) anchors.rightMargin: Style.space(4)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter