From 4e9e8de1541f6c650bc8d5051b9e45e5ebefcdc8 Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 3 Oct 2024 11:56:22 -0300 Subject: [PATCH] adding layerIsReadOnly condition to add feature button to be visible --- app/qml/layers/MMFeaturesListPage.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/qml/layers/MMFeaturesListPage.qml b/app/qml/layers/MMFeaturesListPage.qml index c6550d0a1..3f41f758e 100644 --- a/app/qml/layers/MMFeaturesListPage.qml +++ b/app/qml/layers/MMFeaturesListPage.qml @@ -21,6 +21,7 @@ MMComponents.MMPage { property var selectedLayer: null property bool hasToolbar: false + property bool layerIsReadOnly: featuresModel.layer?.readOnly ?? false signal featureClicked( var featurePair ) signal addFeatureClicked( var toLayer ) @@ -83,6 +84,20 @@ MMComponents.MMPage { anchors.centerIn: parent running: featuresModel.fetchingResults } + + MMComponents.MMButton { + id: addButton + + width: parent.width + anchors.bottom: parent.bottom + anchors.bottomMargin: root.hasToolbar ? __style.margin20 : ( __style.safeAreaBottom + __style.margin8 ) + + visible: __inputUtils.isNoGeometryLayer( root.selectedLayer ) && !root.layerIsReadOnly + + text: qsTr("Add feature") + + onClicked: root.addFeatureClicked( root.selectedLayer ) + } } Component.onCompleted: {