[utilities/kdebugsettings] src/quickapps/contents/ui: Fix show menu + setVisible action

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ae0c6e075e92028ee470cf3f907df89c1c93d759 by Laurent Montel.
Committed on 18/07/2026 at 12:15.
Pushed by mlaurent into branch 'master'.

Fix show menu + setVisible action

M  +13   -6    src/quickapps/contents/ui/CustomRulesPage.qml

https://invent.kde.org/utilities/kdebugsettings/-/commit/ae0c6e075e92028ee470cf3f907df89c1c93d759

diff --git a/src/quickapps/contents/ui/CustomRulesPage.qml b/src/quickapps/contents/ui/CustomRulesPage.qml
index 7871ef1d..ab05ee83 100644
--- a/src/quickapps/contents/ui/CustomRulesPage.qml
+++ b/src/quickapps/contents/ui/CustomRulesPage.qml
@@ -27,11 +27,10 @@ Kirigami.ScrollablePage {
             highlighted: ListView.isCurrentItem
             onClicked: listviewRules.currentIndex = index
 
-            TapHandler {
-                enabled: listviewRules.currentIndex !== -1 && listviewRules.count !== 0
-                acceptedButtons: Qt.RightButton
-                onTapped: contextMenu.popup()
-            }
+        }
+        TapHandler {
+            acceptedButtons: Qt.RightButton
+            onTapped: contextMenu.popup()
         }
 
         QQC2.Menu {
@@ -40,21 +39,29 @@ Kirigami.ScrollablePage {
                 icon.name: "list-add"
                 text: i18nc("@action add custom rule", "Add Rule…")
                 onTriggered: {
+                    console.debug("Not implemented yet")
+
                     // TODO
                 }
             }
             QQC2.MenuItem {
+                visible: listviewRules.currentIndex !== -1 && listviewRules.count !== 0
                 icon.name: "document-edit"
                 text: i18nc("@action edit custom rule", "Edit Rule…")
                 onTriggered: {
+                    console.debug("Not implemented yet")
                     // TODO
                 }
             }
-            QQC2.MenuSeparator {}
+            QQC2.MenuSeparator {
+            visible: listviewRules.currentIndex !== -1 && listviewRules.count !== 0
+            }
             QQC2.MenuItem {
+                visible: listviewRules.currentIndex !== -1 && listviewRules.count !== 0
                 icon.name: "edit-delete"
                 text: i18nc("@action remove custom rule", "Remove Rule")
                 onTriggered: {
+                    console.debug("Not implemented yet")
                     // TODO
                 }
             }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.