Commit f0c7608d authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4881 from dogmaphobic/offlineMaps

Tweaks with the offline maps slider.
parents 333d5c99 fbdc2ca7
...@@ -51,6 +51,7 @@ QGCView { ...@@ -51,6 +51,7 @@ QGCView {
readonly property real minZoomLevel: 3 readonly property real minZoomLevel: 3
readonly property real maxZoomLevel: 20 readonly property real maxZoomLevel: 20
readonly property real sliderTouchArea: ScreenTools.isMobile ? ScreenTools.defaultFontPixelWidth * 5 : ScreenTools.defaultFontPixelWidth * 3
readonly property int _maxTilesForDownload: 100000 readonly property int _maxTilesForDownload: 100000
...@@ -641,6 +642,7 @@ QGCView { ...@@ -641,6 +642,7 @@ QGCView {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelHeight * (ScreenTools.isTinyScreen ? 0.25 : 0.5) spacing: ScreenTools.defaultFontPixelHeight * (ScreenTools.isTinyScreen ? 0.25 : 0.5)
Column { Column {
spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25 spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25
anchors.left: parent.left anchors.left: parent.left
...@@ -652,6 +654,7 @@ QGCView { ...@@ -652,6 +654,7 @@ QGCView {
anchors.right: parent.right anchors.right: parent.right
} }
} }
Column { Column {
spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25 spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25
anchors.left: parent.left anchors.left: parent.left
...@@ -692,21 +695,23 @@ QGCView { ...@@ -692,21 +695,23 @@ QGCView {
Column { Column {
id: zoomColumn id: zoomColumn
spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.25 anchors.margins: ScreenTools.defaultFontPixelHeight * 0.25
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
QGCLabel { QGCLabel {
text: qsTr("Min Zoom: %1").arg(sliderMinZoom.value) text: qsTr("Min/Max Zoom Levels")
font.pointSize: _adjustableFontPointSize font.pointSize: _adjustableFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
} }
Slider { Slider {
id: sliderMinZoom id: sliderMinZoom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: setName.height height: sliderTouchArea * 1.25
minimumValue: minZoomLevel minimumValue: minZoomLevel
maximumValue: maxZoomLevel maximumValue: maxZoomLevel
stepSize: 1 stepSize: 1
...@@ -719,18 +724,37 @@ QGCView { ...@@ -719,18 +724,37 @@ QGCView {
} }
handleChanges() handleChanges()
} }
} // Slider - min zoom style: SliderStyle {
groove: Rectangle {
QGCLabel { implicitWidth: sliderMinZoom.width
text: qsTr("Max Zoom: %1").arg(sliderMaxZoom.value) implicitHeight: 4
font.pointSize: _adjustableFontPointSize color: qgcPal.colorBlue
radius: 4
} }
handle: Rectangle {
anchors.centerIn: parent
color: qgcPal.button
border.color: qgcPal.buttonText
border.width: 1
implicitWidth: sliderTouchArea
implicitHeight: sliderTouchArea
radius: sliderTouchArea * 0.5
Label {
text: sliderMinZoom.value
anchors.centerIn: parent
font.family: ScreenTools.normalFontFamily
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonText
}
}
}
} // Slider - min zoom
Slider { Slider {
id: sliderMaxZoom id: sliderMaxZoom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: setName.height height: sliderTouchArea * 1.25
minimumValue: minZoomLevel minimumValue: minZoomLevel
maximumValue: maxZoomLevel maximumValue: maxZoomLevel
stepSize: 1 stepSize: 1
...@@ -743,13 +767,37 @@ QGCView { ...@@ -743,13 +767,37 @@ QGCView {
} }
handleChanges() handleChanges()
} }
style: SliderStyle {
groove: Rectangle {
implicitWidth: sliderMaxZoom.width
implicitHeight: 4
color: qgcPal.colorBlue
radius: 4
}
handle: Rectangle {
anchors.centerIn: parent
color: qgcPal.button
border.color: qgcPal.buttonText
border.width: 1
implicitWidth: sliderTouchArea
implicitHeight: sliderTouchArea
radius: sliderTouchArea * 0.5
Label {
text: sliderMaxZoom.value
anchors.centerIn: parent
font.family: ScreenTools.normalFontFamily
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonText
}
}
}
} // Slider - max zoom } // Slider - max zoom
GridLayout { GridLayout {
columns: 2 columns: 2
rowSpacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5 rowSpacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5
QGCLabel { QGCLabel {
text: qsTr("Count:") text: qsTr("Tile Count:")
font.pointSize: _adjustableFontPointSize font.pointSize: _adjustableFontPointSize
} }
QGCLabel { QGCLabel {
...@@ -777,11 +825,12 @@ QGCView { ...@@ -777,11 +825,12 @@ QGCView {
} }
Row { Row {
id: addButtonRow
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
QGCButton { QGCButton {
id: downloadButton
text: qsTr("Download") text: qsTr("Download")
width: (addNewSetColumn.width * 0.5) - (addButtonRow.spacing * 0.5)
enabled: !_tooManyTiles && setName.text.length > 0 enabled: !_tooManyTiles && setName.text.length > 0
onClicked: { onClicked: {
if(QGroundControl.mapEngineManager.findName(setName.text)) { if(QGroundControl.mapEngineManager.findName(setName.text)) {
...@@ -794,7 +843,7 @@ QGCView { ...@@ -794,7 +843,7 @@ QGCView {
} }
QGCButton { QGCButton {
text: qsTr("Cancel") text: qsTr("Cancel")
width: downloadButton.width width: (addNewSetColumn.width * 0.5) - (addButtonRow.spacing * 0.5)
onClicked: { onClicked: {
showList() showList()
} }
......
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