Skip to content

Commit

Permalink
Make it possible to remove individual map overlays
Browse files Browse the repository at this point in the history
Map it possible to remove individual map overlays on the map overlay page
by adding an "x" button next to the opacity slider.

As this make the "remove" button kinda redundant repurpose it for a quick
return to map shortcut.
  • Loading branch information
M4rtinK committed Jan 23, 2021
1 parent 90f0fac commit d6fd14c
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions modules/gui_modules/gui_qt5/qml/MapLayersPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,25 @@ BasePage {
id : sliderWrapper
width : lGrid.cellWidth
height : opacitySlider.height
TextButton {
id : removeLayerButton
width : 64 * rWin.c.style.m
anchors.right : parent.right
height : parent.height
text : ""
visible : index != 0

onClicked : {
rWin.log.info("removing layer " + index)
rWin.mapPage.removeMapLayerByIndex(index)
}



}
Slider {
id : opacitySlider
width : lGrid.cellWidth
width : lGrid.cellWidth - removeLayerButton.width
anchors.verticalCenter : parent.verticalCenter
stepSize : 0.1
maximumValue : 1.0
Expand Down Expand Up @@ -118,11 +134,11 @@ BasePage {
width : actionGrid.cellWidth
height : isLastItem ? lGrid.height : 0
visible : layersLW.model.count > 1
text : qsTr("<b>remove</b>")
text : qsTr("<b>back to map</b>")
onClicked : {
rWin.log.info("remove layer")
// remove the last layer
rWin.mapPage.removeMapLayerByIndex(layersLW.model.count - 1)
rWin.log.info("back to map from map overlays page")
// go back to the map page
rWin.push(null, !rWin.animate)
}
}
}
Expand Down

0 comments on commit d6fd14c

Please sign in to comment.