Commit 78e229b2 authored by Don Gagne's avatar Don Gagne

Add preview and zoom numbers

parent 88b9c9cd
......@@ -36,10 +36,13 @@ QGCView {
property var savedCenter: undefined
property real savedZoom: 3
property string savedMapType: ""
property bool _showPreview: true
property bool _saveRealEstate: ScreenTools.isTinyScreen || ScreenTools.isShortScreen
property real _adjustableFontPointSize: _saveRealEstate ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize
property var _mapAdjustedColor: _map.isSatelliteMap ? "white" : "black"
readonly property real minZoomLevel: 3
readonly property real maxZoomLevel: 20
......@@ -315,6 +318,8 @@ QGCView {
visible: false
gesture.flickDeceleration: 3000
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
plugin: Plugin { name: "QGroundControl" }
MapRectangle {
......@@ -599,9 +604,116 @@ QGCView {
} // QGCFlickable
} // Rectangle - defaultInfoView
//-- Add New Set View
Rectangle {
Item {
id: addNewSetView
anchors.fill: parent
visible: false
Map {
id: minZoomPreview
anchors.leftMargin: ScreenTools.defaultFontPixelWidth /2
anchors.topMargin: anchors.leftMargin
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 4
height: parent.height / 4
center: _map.center
activeMapType: _map.activeMapType
zoomLevel: sliderMinZoom.value
gesture.enabled: false
visible: _showPreview
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
plugin: Plugin { name: "QGroundControl" }
MapScale {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.bottomMargin: anchors.leftMargin
anchors.left: parent.left
anchors.bottom: parent.bottom
mapControl: parent
}
}
Map {
id: maxZoomPreview
anchors.topMargin: minZoomPreview.anchors.topMargin
anchors.left: minZoomPreview.left
anchors.top: minZoomPreview.bottom
width: minZoomPreview.width
height: minZoomPreview.height
center: _map.center
activeMapType: _map.activeMapType
zoomLevel: sliderMaxZoom.value
gesture.enabled: false
visible: _showPreview
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
plugin: Plugin { name: "QGroundControl" }
MapScale {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.bottomMargin: anchors.leftMargin
anchors.left: parent.left
anchors.bottom: parent.bottom
mapControl: parent
}
}
Rectangle {
anchors.fill: minZoomPreview
border.color: _mapAdjustedColor
color: "transparent"
visible: _showPreview
QGCLabel {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: _mapAdjustedColor
text: qsTr("Min Zoom: %1").arg(sliderMinZoom.value)
}
}
Rectangle {
anchors.fill: maxZoomPreview
border.color: _mapAdjustedColor
color: "transparent"
visible: _showPreview
QGCLabel {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: _mapAdjustedColor
text: qsTr("Max Zoom: %1").arg(sliderMaxZoom.value)
}
}
MouseArea {
anchors.fill: minZoomPreview
visible: _showPreview
onClicked: _showPreview = false
}
MouseArea {
anchors.fill: maxZoomPreview
visible: _showPreview
onClicked: _showPreview = false
}
QGCButton {
anchors.left: minZoomPreview.left
anchors.top: minZoomPreview.top
text: "Show zoom previews"
visible: !_showPreview
onClicked: _showPreview = !_showPreview
}
//-- Add new set dialog
Rectangle {
anchors.margins: ScreenTools.defaultFontPixelWidth
y: Math.max(anchors.margins, (parent.height - (anchors.margins * 2) - height) / 2)
anchors.right: parent.right
......@@ -610,7 +722,6 @@ QGCView {
color: qgcPal.window
opacity: 0.85
radius: ScreenTools.defaultFontPixelWidth * 0.5
visible: false
QGCLabel {
anchors.margins: ScreenTools.defaultFontPixelHeight / 4
......@@ -718,7 +829,7 @@ QGCView {
anchors.right: parent.right
QGCLabel {
text: qsTr("Min Zoom:")
text: qsTr("Min Zoom: %1").arg(sliderMinZoom.value)
font.pointSize: _adjustableFontPointSize
}
......@@ -745,7 +856,7 @@ QGCView {
} // Slider - min zoom
QGCLabel {
text: qsTr("Max Zoom:")
text: qsTr("Max Zoom: %1").arg(sliderMaxZoom.value)
font.pointSize: _adjustableFontPointSize
}
......@@ -819,7 +930,8 @@ QGCView {
}
} // Column
} // QGCFlickable
} // Rectangle - addNewSetView
} // Rectangle - Add new set dialog
} // Item - Add new set view
} // Map
QGCFlickable {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment