Skip to content

Commit

Permalink
adding layerIsReadOnly condition to add feature button to be visible
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Oct 3, 2024
1 parent f5fa4ae commit 4e9e8de
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/qml/layers/MMFeaturesListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 4e9e8de

Please sign in to comment.