summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-16 14:19:14 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-20 17:01:51 (GMT)
commited28e81c2464c73a65f1ea874bcffd0327b5be41 (patch)
treeccd15adda010063e429612dd6358d52bf0564e55
parentb6845732c6a03de4fbe74c851846f91911b793ea (diff)
Add an about (and a settings stub) dialog
- activated via search menu (tap on search) - remove stack view (features not used) from main screen - simplify state handling - remove condensed mode from placemark dialog, still too confusing - remove re-anchoring of routing button (keep it simple, stupid) - add dependency on qt quick controls 2 (slide view) - remove close button from dev dialog in favor of back button - simplify navigation manager: guidance mode == visible - konqi icons from https://community.kde.org/Promo/Material/Mascots (cherry picked from commit b3f9d543a1417dcec9d3364793f49adc850f3bf3)
-rw-r--r--src/apps/marble-maps/AboutDialog.qml158
-rw-r--r--src/apps/marble-maps/CMakeLists.txt2
-rw-r--r--src/apps/marble-maps/DeveloperDialog.qml7
-rw-r--r--src/apps/marble-maps/MainScreen.qml548
-rw-r--r--src/apps/marble-maps/MarbleMaps.qrc7
-rw-r--r--src/apps/marble-maps/NavigationManager.qml9
-rw-r--r--src/apps/marble-maps/PlacemarkDialog.qml24
-rw-r--r--src/apps/marble-maps/Search.qml155
-rw-r--r--src/apps/marble-maps/SearchField.qml6
-rw-r--r--src/apps/marble-maps/SettingsDialog.qml63
-rw-r--r--src/apps/marble-maps/Waypoint.qml14
-rw-r--r--src/apps/marble-maps/konqi/konqi-app-dev.pngbin0 -> 34971 bytes
-rw-r--r--src/apps/marble-maps/konqi/konqi-books.pngbin0 -> 35827 bytes
-rw-r--r--src/apps/marble-maps/konqi/konqi-dev-qt.pngbin0 -> 45023 bytes
-rw-r--r--src/apps/marble-maps/konqi/konqi-globe.pngbin0 -> 72713 bytes
-rw-r--r--src/apps/marble-maps/konqi/konqi-group.pngbin0 -> 83404 bytes
16 files changed, 620 insertions, 373 deletions
diff --git a/src/apps/marble-maps/AboutDialog.qml b/src/apps/marble-maps/AboutDialog.qml
new file mode 100644
index 0000000..0831a49
--- /dev/null
+++ b/src/apps/marble-maps/AboutDialog.qml
@@ -0,0 +1,158 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2016 Dennis Nienhüser <nienhueser@kde.org>
+//
+
+import QtQuick 2.3
+import QtQuick.Controls 2.0
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+
+import org.kde.marble 0.20
+
+Item {
+ id: root
+
+ SystemPalette {
+ id: palette
+ colorGroup: SystemPalette.Active
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: palette.base
+ }
+
+ SwipeView {
+ id: tabView
+ currentIndex: pageIndicator.currentIndex
+ anchors.fill: parent
+
+ Item {
+ Text {
+ id: marbleText
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: marbleLogo.left
+ anchors.margins: Screen.pixelDensity * 1
+ anchors.leftMargin: Screen.pixelDensity * 2
+
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ text: qsTr("<h3>Marble Maps</h3><p>Find your way! Marble Maps brings the highly detailed OpenStreetMap to your mobile devices. It features a crisp, beautiful map with an intuitive user interface. It's open source, entirely based on free data and open standards and respects your privacy.</p>")
+ onLinkActivated: Qt.openUrlExternally(link)
+ }
+
+ Image {
+ id: marbleLogo
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.margins: Screen.pixelDensity * 2
+
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/konqi/globe.png"
+ }
+ }
+ Item {
+ Text {
+ id: groupText
+ anchors.left: parent.left
+ anchors.right: groupKonqi.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.margins: Screen.pixelDensity * 1
+ anchors.leftMargin: Screen.pixelDensity * 2
+
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ text: qsTr("<h3>Support</h3><p>Do you have a question? Want to file a suggestion for improvement? Please use the <a href=\"https://forum.kde.org/viewforum.php?f=217\">Marble forum</a> to get in touch with fellow Marble users and developers. Further support channels are listed at <a href=\"https://marble.kde.org/support.php\">marble.kde.org</a>. We are looking forward to your feedback!</p>")
+ onLinkActivated: Qt.openUrlExternally(link)
+ }
+
+ Image {
+ id: groupKonqi
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.topMargin: Screen.pixelDensity * 3
+ anchors.bottomMargin: Screen.pixelDensity * 3
+ anchors.rightMargin: Screen.pixelDensity * 2
+
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/konqi/group.png"
+ }
+ }
+ Item {
+ Text {
+ id: devText
+ anchors.left: parent.left
+ anchors.right: devKonqi.left
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.margins: Screen.pixelDensity * 1
+ anchors.leftMargin: Screen.pixelDensity * 2
+
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ text: qsTr("<h3>Development Team</h3><p>More than 200 developers have already contributed to Marble. The main developers of this app are Dennis Nienhüser, Torsten Rahn, Sanjiban Bairagya, Friedrich W. H. Kossebau, Gábor Péterffy and Mikhail Ivchenko. Contact us via <a href=\"https://mail.kde.org/mailman/listinfo/marble-devel\">marble-devel@kde.org</a>.</p>")
+ onLinkActivated: Qt.openUrlExternally(link)
+ }
+
+ Image {
+ id: devKonqi
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.topMargin: Screen.pixelDensity * 3
+ anchors.bottomMargin: Screen.pixelDensity * 3
+ anchors.rightMargin: Screen.pixelDensity * 2
+
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/konqi/app-dev.png"
+ }
+ }
+ Item {
+
+ Text {
+ id: attributionText
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: devQtKonqi.left
+ anchors.bottom: parent.bottom
+ anchors.margins: Screen.pixelDensity * 1
+ anchors.leftMargin: Screen.pixelDensity * 2
+
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ width: parent.width
+ text: qsTr("<h3>Attribution</h3><p>The map uses public domain data from the <a href=\"http://www.naturalearthdata.com/\">Natural Earth</a> project. Additionally data from the <a href=\"https://www.openstreetmap.org\">OpenStreetMap</a> project is used, available under the <a href=\"http://opendatacommons.org/licenses/odbl/\">Open Database License</a>. The map style is influenced by and uses icons from <a href=\"https://github.com/gravitystorm/openstreetmap-carto\">OpenStreetMap Carto</a> (<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">CC0 Public Domain)</a>.</p>")
+ onLinkActivated: Qt.openUrlExternally(link)
+ }
+
+ Image {
+ id: devQtKonqi
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.topMargin: Screen.pixelDensity * 3
+ anchors.bottomMargin: Screen.pixelDensity * 3
+ anchors.rightMargin: Screen.pixelDensity * 2
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/konqi/dev-qt.png"
+ }
+ }
+ }
+
+ PageIndicator {
+ id: pageIndicator
+ interactive: true
+ count: tabView.count
+ currentIndex: tabView.currentIndex
+
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+}
diff --git a/src/apps/marble-maps/CMakeLists.txt b/src/apps/marble-maps/CMakeLists.txt
index d0f3434..2111aa0 100644
--- a/src/apps/marble-maps/CMakeLists.txt
+++ b/src/apps/marble-maps/CMakeLists.txt
@@ -7,6 +7,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL Android)
set(TARGET Marble)
find_package(Qt5AndroidExtras)
+ find_package(Qt5QuickControls2)
add_library (${TARGET} SHARED ${marble_SRCS} ${marble_QRCS})
@@ -26,6 +27,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL Android)
Qt5::Positioning
Qt5::AndroidExtras
Qt5::Multimedia
+ Qt5::QuickControls2
)
else()
set(TARGET marble-maps)
diff --git a/src/apps/marble-maps/DeveloperDialog.qml b/src/apps/marble-maps/DeveloperDialog.qml
index 6bd35cd..80e1975 100644
--- a/src/apps/marble-maps/DeveloperDialog.qml
+++ b/src/apps/marble-maps/DeveloperDialog.qml
@@ -49,7 +49,7 @@ Item {
margins: Screen.pixelDensity * 2
}
- spacing: Screen.pixelDensity * 2
+ spacing: Screen.pixelDensity * 1
Text {
id: text
@@ -81,10 +81,5 @@ Item {
checked: settings.value("Developer", "debugPolygons") === "true"
onCheckedChanged: marbleMaps.setShowDebugPolygons(checked)
}
-
- Button {
- text: "Close"
- onClicked: root.visible = false
- }
}
}
diff --git a/src/apps/marble-maps/MainScreen.qml b/src/apps/marble-maps/MainScreen.qml
index 3262507..77e0831 100644
--- a/src/apps/marble-maps/MainScreen.qml
+++ b/src/apps/marble-maps/MainScreen.qml
@@ -36,344 +36,304 @@ ApplicationWindow {
color: palette.window
}
- StackView {
- id: itemStack
-
- anchors.fill: parent
-
- initialItem: mapItem
-
- delegate: StackViewDelegate {
- function transitionFinished(properties)
- {
- properties.exitItem.visible = true
- }
+ Item {
+ id: mapItem
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ bottom: dialogContainer.top
}
- Item {
- id: mapItem
-
- PinchArea {
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- bottom: dialogContainer.top
+ PinchArea {
+ anchors.fill: parent
+ enabled: true
+
+ onPinchStarted: marbleMaps.handlePinchStarted(pinch.center)
+ onPinchFinished: marbleMaps.handlePinchFinished(pinch.center)
+ onPinchUpdated: marbleMaps.handlePinchUpdated(pinch.center, pinch.scale);
+
+ MarbleMaps {
+ id: marbleMaps
+
+ property string currentPositionProvider: "QtPositioning"
+ property bool wlanOnly: false
+
+ anchors.fill: parent
+
+ visible: true
+
+ // Theme settings.
+ projection: MarbleItem.Mercator
+ mapThemeId: "earth/vectorosm/vectorosm.dgml"
+
+ // Visibility of layers/plugins.
+ showFrameRate: false
+ showAtmosphere: false
+ showCompass: false
+ showClouds: false
+ showCrosshairs: false
+ showGrid: false
+ showOverviewMap: false
+ showOtherPlaces: false
+ showScaleBar: false
+ showBackground: false
+ positionProvider: suspended ? "" : currentPositionProvider
+ keepScreenOn: !suspended && navigationManager.visible
+ showPositionMarker: false
+
+ placemarkDelegate: Image {
+ property int xPos: 0
+ property int yPos: 0
+ property var placemark: null
+ x: xPos - 0.5 * width
+ y: yPos - height
+ width: Screen.pixelDensity*6
+ height: width
+ source: "qrc:///ic_place.png"
+ onPlacemarkChanged: {
+ placemarkDialog.item.placemark = placemark
+ }
}
- enabled: true
-
- onPinchStarted: marbleMaps.handlePinchStarted(pinch.center)
- onPinchFinished: marbleMaps.handlePinchFinished(pinch.center)
- onPinchUpdated: marbleMaps.handlePinchUpdated(pinch.center, pinch.scale);
-
- MarbleMaps {
- id: marbleMaps
-
- property string currentPositionProvider: "QtPositioning"
- anchors.fill: parent
+ onPositionAvailableChanged: {
+ updateIndicator();
+ }
+ onPositionVisibleChanged: {
+ updateIndicator();
+ }
+ onVisibleLatLonAltBoxChanged: {
+ updateIndicator();
+ }
+ onCurrentPositionChanged: {
+ updateIndicator();
+ }
- visible: true
-
- // Theme settings.
- projection: MarbleItem.Mercator
- mapThemeId: "earth/vectorosm/vectorosm.dgml"
-
- // Visibility of layers/plugins.
- showFrameRate: false
- showAtmosphere: false
- showCompass: false
- showClouds: false
- showCrosshairs: false
- showGrid: false
- showOverviewMap: false
- showOtherPlaces: false
- showScaleBar: false
- showBackground: false
- positionProvider: suspended ? "" : currentPositionProvider
- keepScreenOn: !suspended && itemStack.state === "navigation"
- showPositionMarker: false
-
- placemarkDelegate: Image {
- property int xPos: 0
- property int yPos: 0
- property var placemark: null
- x: xPos - 0.5 * width
- y: yPos - height
- width: Screen.pixelDensity*6
- height: width
- source: "qrc:///ic_place.png"
- onPlacemarkChanged: {
- placemarkDialog.placemark = placemark
- }
- }
+ Component.onCompleted: marbleMaps.loadSettings()
+ Component.onDestruction: marbleMaps.writeSettings()
- onPositionAvailableChanged: {
- updateIndicator();
- }
- onPositionVisibleChanged: {
- updateIndicator();
- }
- onVisibleLatLonAltBoxChanged: {
- updateIndicator();
- }
- onCurrentPositionChanged: {
- updateIndicator();
+ function updateIndicator() {
+ if ( !positionVisible && positionAvailable ) {
+ zoomToPositionButton.updateIndicator();
}
+ }
- Component.onCompleted: marbleMaps.loadSettings()
- Component.onDestruction: marbleMaps.writeSettings()
+ RoutingManager {
+ id: routing
+ anchors.fill: parent
+ marbleItem: marbleMaps
+ routingProfile: routeEditor.item.routingProfile
+ }
- function updateIndicator() {
- if ( !positionVisible && positionAvailable ) {
- zoomToPositionButton.updateIndicator();
- }
- }
+ PositionMarker {
+ id: positionMarker
+ posX: navigationManager.snappedPositionMarkerScreenPosition.x
+ posY: navigationManager.snappedPositionMarkerScreenPosition.y
+ angle: marbleMaps.angle
+ visible: marbleMaps.positionAvailable && marbleMaps.positionVisible
+ radius: navigationManager.screenAccuracy
+ color: navigationManager.deviated ? "#40ff0000" : "transparent"
+ border.color: navigationManager.deviated ? "red" : "transparent"
+ }
- RoutingManager {
- id: routing
- anchors.fill: parent
- marbleItem: marbleMaps
- routingProfile: routeEditor.routingProfile
+ MouseArea {
+ anchors.fill: parent
+ propagateComposedEvents: true
+ onPressed: {
+ marbleMaps.focus = true;
+ mouse.accepted = false;
}
+ }
- PositionMarker {
- id: positionMarker
- posX: navigationManager.snappedPositionMarkerScreenPosition.x
- posY: navigationManager.snappedPositionMarkerScreenPosition.y
- angle: marbleMaps.angle
- visible: marbleMaps.positionAvailable && marbleMaps.positionVisible
- radius: navigationManager.screenAccuracy
- color: navigationManager.deviated ? "#40ff0000" : "transparent"
- border.color: navigationManager.deviated ? "red" : "transparent"
- }
+ Search {
+ id: search
+ anchors.fill: parent
+ marbleQuickItem: marbleMaps
+ routingManager: routing
+ visible: !navigationManager.visible
+ }
- MouseArea{
- anchors.fill: parent
- propagateComposedEvents: true
- onPressed: {
- marbleMaps.focus = true;
- mouse.accepted = false;
+ BoxedText {
+ id: quitHelper
+ visible: false
+ text: qsTr("Press again to close.")
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: Screen.pixelDensity * 5
+ anchors.horizontalCenter: parent.horizontalCenter
+ onVisibleChanged: {
+ if (visible) {
+ quitTimer.restart()
}
}
- Search {
- id: search
- anchors.fill: parent
- marbleQuickItem: marbleMaps
- routingManager: routing
- visible: !navigationManager.visible
- }
-
- BoxedText {
- id: quitHelper
- visible: false
- text: qsTr("Press again to close.")
- anchors.bottom: parent.bottom
- anchors.bottomMargin: Screen.pixelDensity * 5
- anchors.horizontalCenter: parent.horizontalCenter
- onVisibleChanged: {
- if (visible) {
- quitTimer.restart()
- }
- }
-
- Timer {
- id: quitTimer
- interval: 3000;
- running: false;
- repeat: false
- onTriggered: itemStack.state = ""
+ Timer {
+ id: quitTimer
+ interval: 3000;
+ running: false;
+ repeat: false
+ onTriggered: {
+ marbleMaps.state = ""
+ quitHelper.visible = false
}
}
}
- NavigationManager {
- id: navigationManager
- width: parent.width
- height: parent.height
- visible: false
- marbleItem: marbleMaps
+ Keys.onBackPressed: {
+ if (marbleMaps.state === "aboutToQuit") {
+ event.accepted = false // we will quit
+ } else if (navigationManager.visible) {
+ navigationManager.visible = false
+ event.accepted = true
+ } else if (dialogContainer.visible) {
+ dialogContainer.currentIndex = dialogContainer.none
+ event.accepted = true
+ } else if (marbleMaps.state === "") {
+ marbleMaps.state = "aboutToQuit"
+ quitHelper.visible = true
+ event.accepted = true
+ } else {
+ marbleMaps.state = ""
+ event.accepted = true
+ }
}
}
- BorderImage {
- anchors.fill: dialogContainer
- anchors.margins: -14
- border { top: 14; left: 14; right: 14; bottom: 14 }
- source: "qrc:///border_shadow.png"
+ NavigationManager {
+ id: navigationManager
+ width: parent.width
+ height: parent.height
+ visible: false
+ marbleItem: marbleMaps
}
+ }
- Item {
- id: dialogContainer
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: routeEditor.visible ? routeEditor.height : (placemarkDialog.visible ? placemarkDialog.height : 0)
-
- RouteEditor {
- id: routeEditor
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- visible: false
- }
-
- PlacemarkDialog {
- id: placemarkDialog
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- map: marbleMaps
- }
-
- DeveloperDialog {
- id: developerDialog
- visible: false
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- }
+ BoxedText {
+ id: distanceIndicator
+ text: qsTr("%1 km").arg(zoomToPositionButton.distance < 10 ? zoomToPositionButton.distance.toFixed(1) : zoomToPositionButton.distance.toFixed(0))
+ anchors {
+ bottom: zoomToPositionButton.top
+ horizontalCenter: zoomToPositionButton.horizontalCenter
}
- BoxedText {
- id: distanceIndicator
- text: qsTr("%1 km").arg(zoomToPositionButton.distance < 10 ? zoomToPositionButton.distance.toFixed(1) : zoomToPositionButton.distance.toFixed(0))
- anchors {
- bottom: zoomToPositionButton.top
- horizontalCenter: zoomToPositionButton.horizontalCenter
- }
+ visible: marbleMaps.positionAvailable && !marbleMaps.positionVisible
+ }
- visible: marbleMaps.positionAvailable && !marbleMaps.positionVisible
+ PositionButton {
+ id: zoomToPositionButton
+ anchors {
+ right: parent.right
+ rightMargin: Screen.pixelDensity * 1
+ bottom: routeEditorButton.top
+ bottomMargin: 10
}
- PositionButton {
- id: zoomToPositionButton
- anchors {
- right: parent.right
- rightMargin: Screen.pixelDensity * 1
- bottom: routeEditorButton.top
- bottomMargin: 10
- }
+ iconSource: marbleMaps.positionAvailable ? "qrc:///gps_fixed.png" : "qrc:///gps_not_fixed.png"
- iconSource: marbleMaps.positionAvailable ? "qrc:///gps_fixed.png" : "qrc:///gps_not_fixed.png"
+ onClicked: marbleMaps.centerOnCurrentPosition()
- onClicked: marbleMaps.centerOnCurrentPosition()
+ property real distance: 0
- property real distance: 0
+ function updateIndicator() {
+ var point = marbleMaps.mapFromItem(zoomToPositionButton, diameter * 0.5, diameter * 0.5);
+ distance = 0.001 * marbleMaps.distanceFromPointToCurrentLocation(point);
+ angle = marbleMaps.angleFromPointToCurrentLocation(point);
+ }
- function updateIndicator() {
- var point = marbleMaps.mapFromItem(zoomToPositionButton, diameter * 0.5, diameter * 0.5);
- distance = 0.001 * marbleMaps.distanceFromPointToCurrentLocation(point);
- angle = marbleMaps.angleFromPointToCurrentLocation(point);
- }
+ showDirection: marbleMaps.positionAvailable && !marbleMaps.positionVisible
+ }
- showDirection: marbleMaps.positionAvailable && !marbleMaps.positionVisible
+ CircularButton {
+ id: routeEditorButton
+ anchors {
+ bottom: parent.bottom
+ horizontalCenter: zoomToPositionButton.horizontalCenter
+ bottomMargin: Screen.pixelDensity * 4
}
- CircularButton {
- id: routeEditorButton
- anchors {
- bottom: dialogContainer.height > 0 ? undefined : parent.bottom
- verticalCenter: dialogContainer.height > 0 ? dialogContainer.top : undefined
- horizontalCenter: zoomToPositionButton.horizontalCenter
- bottomMargin: Screen.pixelDensity * 4
- }
-
- onClicked: {
- if (itemStack.state === "routing") {
- itemStack.state = "navigation"
- } else if (itemStack.state === "place") {
- placemarkDialog.addToRoute()
- } else {
- itemStack.state = "routing"
- }
+ onClicked: {
+ if (dialogContainer.currentIndex === dialogContainer.routing) {
+ dialogContainer.currentIndex = dialogContainer.none
+ navigationManager.visible = true
+ } else if (dialogContainer.currentIndex === dialogContainer.place) {
+ dialogContainer.currentIndex = dialogContainer.routing
+ placemarkDialog.item.addToRoute()
+ } else {
+ dialogContainer.currentIndex = dialogContainer.routing
+ navigationManager.visible = false
}
- iconSource: "qrc:///material/directions.svg";
-
- states: [
- State {
- name: ""
- AnchorChanges { target: routeEditorButton; anchors.bottom: parent.bottom; anchors.verticalCenter: undefined; }
- PropertyChanges { target: routeEditorButton; iconSource: "qrc:///material/directions.svg"; }
- },
- State {
- name: "routingAction"
- when: itemStack.state == "routing"
- AnchorChanges { target: routeEditorButton; anchors.bottom: undefined; anchors.verticalCenter: dialogContainer.top; }
- PropertyChanges { target: routeEditorButton; iconSource: "qrc:///material/navigation.svg"; }
- },
- State {
- name: "placeAction"
- when: itemStack.state == "place"
- AnchorChanges { target: routeEditorButton; anchors.bottom: undefined; anchors.verticalCenter: dialogContainer.top; }
- PropertyChanges { target: routeEditorButton; iconSource: placemarkDialog.actionIconSource }
- }
- ]
}
+ iconSource: "qrc:///material/directions.svg";
+
+ states: [
+ State {
+ name: ""
+ PropertyChanges { target: routeEditorButton; iconSource: "qrc:///material/directions.svg"; }
+ },
+ State {
+ name: "routingAction"
+ when: dialogContainer.currentIndex === dialogContainer.routing
+ PropertyChanges { target: routeEditorButton; iconSource: "qrc:///material/navigation.svg"; }
+ },
+ State {
+ name: "placeAction"
+ when: dialogContainer.currentIndex === dialogContainer.place
+ PropertyChanges { target: routeEditorButton; iconSource: placemarkDialog.item.actionIconSource }
+ }
+ ]
}
+ }
- states: [
- State {
- name: ""
- PropertyChanges { target: quitHelper; visible: false }
- PropertyChanges { target: search; visible: true }
- PropertyChanges { target: placemarkDialog; visible: false }
- PropertyChanges { target: routeEditor; visible: false }
- PropertyChanges { target: navigationManager; guidanceMode: false }
- StateChangeScript { script: itemStack.pop(mapItem); }
- },
- State {
- name: "place"
- PropertyChanges { target: search; visible: true }
- PropertyChanges { target: placemarkDialog; visible: true }
- PropertyChanges { target: routeEditor; visible: false }
- PropertyChanges { target: navigationManager; guidanceMode: false }
- StateChangeScript { script: itemStack.pop(mapItem); }
- },
- State {
- name: "routing"
- PropertyChanges { target: search; visible: true }
- PropertyChanges { target: placemarkDialog; visible: false }
- PropertyChanges { target: routeEditor; visible: true }
- PropertyChanges { target: navigationManager; guidanceMode: false }
- StateChangeScript { script: itemStack.pop(mapItem); }
- },
- State {
- name: "navigation"
- PropertyChanges { target: search; visible: false }
- PropertyChanges { target: placemarkDialog; visible: false }
- PropertyChanges { target: routeEditor; visible: false }
- PropertyChanges { target: navigationManager; guidanceMode: true }
- StateChangeScript { script: itemStack.push(navigationManager); }
- },
- State {
- name: "aboutToQuit"
- PropertyChanges { target: quitHelper; visible: true }
+ TabView {
+ id: dialogContainer
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ tabsVisible: false
+ frameVisible: false
+ visible: currentIndex >= 0
+ height: visible ? 0.33 * root.height : 0
+
+ readonly property int none: -1
+ readonly property int routing: 0
+ readonly property int place: 1
+ readonly property int about: 2
+ readonly property int settings: 3
+ readonly property int developer: 4
+
+ currentIndex: none
+ Keys.onBackPressed: currentIndex = none
+
+ Tab {
+ active: true
+ id: routeEditor
+ RouteEditor {
+ anchors.fill: parent
}
+ }
- ]
-
- Keys.onBackPressed: {
- if (itemStack.state === "aboutToQuit") {
- event.accepted = false // we will quit
- }
- else if (itemStack.state === "") {
- itemStack.state = "aboutToQuit"
- event.accepted = true
- }
- else {
- itemStack.state = ""
- event.accepted = true
+ Tab {
+ active: true
+ id: placemarkDialog
+ PlacemarkDialog {
+ anchors.fill: parent
+ map: marbleMaps
}
}
+
+ Tab { AboutDialog {} }
+ Tab { active: true; SettingsDialog {} }
+ Tab { active: true; DeveloperDialog {} }
+ }
+
+ BorderImage {
+ visible: dialogContainer.visible
+ anchors.fill: dialogContainer
+ anchors.margins: -14
+ border { top: 14; left: 14; right: 14; bottom: 14 }
+ source: "qrc:///border_shadow.png"
}
+
+ Keys.onBackPressed: event.accepted = true
}
diff --git a/src/apps/marble-maps/MarbleMaps.qrc b/src/apps/marble-maps/MarbleMaps.qrc
index 0549e1d..61f2c00 100644
--- a/src/apps/marble-maps/MarbleMaps.qrc
+++ b/src/apps/marble-maps/MarbleMaps.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
+ <file>AboutDialog.qml</file>
<file>FlatButton.qml</file>
<file>Completion.qml</file>
<file>MainScreen.qml</file>
@@ -14,6 +15,7 @@
<file>WaypointImage.qml</file>
<file>RoutingManager.qml</file>
<file>PlacemarkDialog.qml</file>
+ <file>SettingsDialog.qml</file>
<file>DeveloperDialog.qml</file>
<file>ProfileSelectorMenu.qml</file>
<file>FloatingMenuButton.qml</file>
@@ -57,6 +59,11 @@
<file alias="material/place.svg">material-icons/ic_place_black_48px.svg</file>
<file alias="material/star.svg">material-icons/ic_star_24px.svg</file>
<file alias="material/star_border.svg">material-icons/ic_star_border_24px.svg</file>
+ <file alias="konqi/app-dev.png">konqi/konqi-app-dev.png</file>
+ <file alias="konqi/dev-qt.png">konqi/konqi-dev-qt.png</file>
+ <file alias="konqi/group.png">konqi/konqi-group.png</file>
+ <file alias="konqi/globe.png">konqi/konqi-globe.png</file>
+ <file alias="konqi/books.png">konqi/konqi-books.png</file>
<file>RouteProfileRadioButton.qml</file>
<file>ScrollBar.qml</file>
</qresource>
diff --git a/src/apps/marble-maps/NavigationManager.qml b/src/apps/marble-maps/NavigationManager.qml
index cb1a796..1710165 100644
--- a/src/apps/marble-maps/NavigationManager.qml
+++ b/src/apps/marble-maps/NavigationManager.qml
@@ -20,17 +20,16 @@ Item {
property var marbleItem: null
property var tts: null
property alias snappedPositionMarkerScreenPosition: navigation.screenPosition
- property bool guidanceMode: false
property alias screenAccuracy: navigation.screenAccuracy
property alias deviated: navigation.deviated
- onGuidanceModeChanged: {
- if (guidanceMode) {
+ onVisibleChanged: {
+ if (visible) {
marbleItem.setZoomToMaximumLevel();
marbleItem.centerOnCurrentPosition();
}
- navigation.guidanceModeEnabled = guidanceMode;
+ navigation.guidanceModeEnabled = visible;
}
Settings {
@@ -77,7 +76,7 @@ Item {
marbleQuickItem: marbleItem
onVoiceNavigationAnnouncementChanged: {
- if (root.guidanceMode && !muteButton.muted) {
+ if (root.visible && !muteButton.muted) {
textToSpeechClient.readText(voiceNavigationAnnouncement);
}
}
diff --git a/src/apps/marble-maps/PlacemarkDialog.qml b/src/apps/marble-maps/PlacemarkDialog.qml
index 774947c..f4cbc70 100644
--- a/src/apps/marble-maps/PlacemarkDialog.qml
+++ b/src/apps/marble-maps/PlacemarkDialog.qml
@@ -19,8 +19,7 @@ Item {
id: root
property var placemark: null
- property bool condensed: true
- property string actionIconSource: routeEditor.currentProfileIcon
+ property string actionIconSource: routeEditor.item.currentProfileIcon
property alias map: bookmarks.map
height: placemark === null ? 0 : Screen.pixelDensity * 6 +
@@ -31,16 +30,15 @@ Item {
routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark)
routing.clearSearchResultPlacemarks()
placemark = null
- itemStack.state = "routing"
+ dialogContainer.currentIndex = dialogContainer.routing
}
onPlacemarkChanged: {
if (placemark) {
bookmarkButton.bookmark = bookmarks.isBookmark(placemark.longitude, placemark.latitude)
- itemStack.state = "place"
+ dialogContainer.currentIndex = dialogContainer.place
} else {
- condensed = true
- itemStack.state = ""
+ dialogContainer.currentIndex = dialogContainer.none
}
}
@@ -54,13 +52,6 @@ Item {
color: palette.base
}
- MouseArea {
- anchors.fill: parent
- onClicked: {
- condensed = !condensed
- }
- }
-
Bookmarks {
id: bookmarks
}
@@ -87,7 +78,6 @@ Item {
width: parent.width
visible: text.length > 0
text: placemark === null ? "" : placemark.description
- maximumLineCount: condensed ? 4 : undefined
}
IconText {
@@ -110,7 +100,7 @@ Item {
IconText {
width: parent.width
- visible: text.length > 0 && (!condensed || name.text === "")
+ visible: text.length > 0
text: placemark === null ? "" : placemark.address
maximumLineCount: 4
}
@@ -149,7 +139,7 @@ Item {
IconText {
width: parent.width
- visible: text.length > 0 && (!condensed || name.text === "")
+ visible: text.length > 0
text: placemark === null ? "" : placemark.coordinates
icon: "qrc:/material/place.svg"
}
@@ -158,7 +148,7 @@ Item {
Image {
id: bookmarkButton
anchors.right: parent.right
- anchors.bottom: parent.bottom
+ anchors.top: parent.top
anchors.margins: Screen.pixelDensity * 2
visible: root.height > 0
diff --git a/src/apps/marble-maps/Search.qml b/src/apps/marble-maps/Search.qml
index d70c19c..e64d350 100644
--- a/src/apps/marble-maps/Search.qml
+++ b/src/apps/marble-maps/Search.qml
@@ -9,7 +9,7 @@
//
import QtQuick 2.3
-import QtQuick.Controls 1.3
+import QtQuick.Controls 2.0
import QtQuick.Window 2.2
import org.kde.marble 0.20
@@ -31,11 +31,16 @@ Item {
}
}
- SystemPalette{
+ SystemPalette {
id: palette
colorGroup: SystemPalette.Active
}
+ SystemPalette {
+ id: paletteDisabled
+ colorGroup: SystemPalette.Disabled
+ }
+
SearchResults {
id: searchResults
anchors {
@@ -53,74 +58,142 @@ Item {
if (routingManager) {
routingManager.addSearchResultAsPlacemark(backend.selectedPlacemark);
}
- placemarkDialog.placemark = backend.selectedPlacemark;
+ placemarkDialog.item.placemark = backend.selectedPlacemark;
}
}
Rectangle {
id: background
- visible: searchField.hasFocus && searchField.query === "" && bookmarks.model.count > 0
+ visible: searchField.hasFocus && searchField.query === ""
anchors.top: searchField.bottom
anchors.left: searchField.left
width: searchField.width
- height: 2 * background.itemSpacing + (delegateHeight) * Math.min(4, bookmarksView.model.count)
+ height: childrenRect.height + 2 * itemSpacing
color: palette.base
property int delegateHeight: 0
+
property double itemSpacing: Screen.pixelDensity * 1
- ListView {
- id: bookmarksView
- anchors.fill: parent
+ Column {
+ anchors.top: parent.top
+ anchors.topMargin: background.itemSpacing
+ anchors.left: parent.left
+ anchors.right: parent.right
anchors.margins: background.itemSpacing
- clip: true
+ spacing: background.itemSpacing
+
+ ListView {
+ id: bookmarksView
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: background.delegateHeight * Math.min(6, model.count)
+ clip: true
+ ScrollIndicator.vertical: ScrollIndicator { }
+
+ model: bookmarks.model
+ delegate: Row {
+ width: bookmarksView.width
+ spacing: background.itemSpacing
+
+ Image {
+ id: bookmarkIcon
+ anchors.verticalCenter: parent.verticalCenter
+ source: iconPath.substr(0,1) === '/' ? "file://" + iconPath : iconPath
+ width: Screen.pixelDensity * 4
+ height: width
+ sourceSize.width: width
+ sourceSize.height: height
+ }
- model: bookmarks.model
- delegate: Row {
- spacing: background.itemSpacing
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.leftMargin: Screen.pixelDensity * 2
+ width: bookmarksView.width - bookmarksView.spacing - bookmarkIcon.width
+ text: display
+ font.pointSize: 18
+ color: palette.text
+ elide: Text.ElideMiddle
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ bookmarksView.currentIndex = index
+ dialogContainer.focus = true
+ placemarkDialog.item.placemark = bookmarks.placemark(index);
+ marbleMaps.centerOn(placemarkDialog.item.placemark.longitude, placemarkDialog.item.placemark.latitude)
+ }
+ }
+ }
- Image {
- anchors.verticalCenter: parent.verticalCenter
- source: iconPath.substr(0,1) === '/' ? "file://" + iconPath : iconPath
- width: Screen.pixelDensity * 4
- height: width
- sourceSize.width: width
- sourceSize.height: height
+ onHeightChanged: {
+ if( background.delegateHeight !== height ) {
+ background.delegateHeight = height;
+ }
+ }
}
+ }
+
+ Row {
+ visible: bookmarksView.model.count === 0
+ width: parent.width
Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: Screen.pixelDensity * 2
- text: display
+ anchors.bottom: parent.bottom
+ width: 0.8 * parent.width
font.pointSize: 18
- color: palette.text
- elide: Text.ElideMiddle
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- bookmarksView.currentIndex = index
- placemarkDialog.focus = true
- placemarkDialog.placemark = bookmarks.placemark(index);
- marbleMaps.centerOn(placemarkDialog.placemark.longitude, placemarkDialog.placemark.latitude)
- }
- }
+ color: paletteDisabled.text
+ text: qsTr("Your bookmarks will appear here.")
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ elide: Text.ElideRight
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ width: 0.2 * parent.width
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/konqi/books.png"
}
+ }
+
+ Rectangle {
+ height: 1
+ width: parent.width
+ color: "gray"
+ }
- Component.onCompleted: {
- if( background.delegateHeight !== height ) {
- background.delegateHeight = height;
+ Text {
+ font.pointSize: 18
+ color: palette.text
+ width: parent.width
+ text: qsTr("About Marble Maps…")
+ elide: Text.ElideRight
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ dialogContainer.currentIndex = dialogContainer.about
+ dialogContainer.focus = true
}
}
}
- }
- ScrollBar {
- flickableItem: bookmarksView
+ /*
+ Text {
+ font.pointSize: 18
+ color: palette.text
+ text: qsTr("Settings")
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ dialogContainer.currentIndex = dialogContainer.settings
+ dialogContainer.focus = true
+ }
+ }
+ }
+ */
}
}
-
SearchBackend {
id: backend
marbleQuickItem: root.marbleQuickItem
diff --git a/src/apps/marble-maps/SearchField.qml b/src/apps/marble-maps/SearchField.qml
index 3e645bb..7ff6c34 100644
--- a/src/apps/marble-maps/SearchField.qml
+++ b/src/apps/marble-maps/SearchField.qml
@@ -32,7 +32,7 @@ Item {
routing.clearSearchResultPlacemarks();
query = query.trim();
if(query.toLowerCase() === "ok marble") {
- developerDialog.visible = true;
+ dialogContainer.currentIndex = dialogContainer.developer;
} else if(query !== "") {
root.busy = true;
searchRequested(query);
@@ -101,8 +101,8 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
- placemarkDialog.placemark = null;
- itemStack.state = "";
+ placemarkDialog.item.placemark = null;
+ dialogContainer.currentIndex = dialogContainer.none
routing.clearSearchResultPlacemarks();
field.text = "";
field.focus = true;
diff --git a/src/apps/marble-maps/SettingsDialog.qml b/src/apps/marble-maps/SettingsDialog.qml
new file mode 100644
index 0000000..bdad4c3
--- /dev/null
+++ b/src/apps/marble-maps/SettingsDialog.qml
@@ -0,0 +1,63 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2016 Dennis Nienhüser <nienhueser@kde.org>
+//
+
+import QtQuick 2.3
+import QtQuick.Controls 1.3
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+
+import org.kde.marble 0.20
+
+Item {
+ id: root
+ height: column.height + Screen.pixelDensity * 4
+
+ SystemPalette {
+ id: palette
+ colorGroup: SystemPalette.Active
+ }
+
+ Settings {
+ id: settings
+
+ Component.onDestruction: {
+ settings.setValue("Network", "wlanOnly", wlanOnly.checked ? "true" : "false")
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: palette.base
+ }
+
+ Column {
+ id: column
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ margins: Screen.pixelDensity * 2
+ }
+
+ spacing: Screen.pixelDensity * 2
+
+ Text {
+ id: text
+ text: "Network Settings"
+ }
+
+ CheckBox {
+ id: wlanOnly
+ text: "Download Maps via WLAN only"
+ checked: settings.value("Network", "wlanOnly") === "true"
+ onCheckedChanged: marbleMaps.wlanOnly = checked
+ }
+ }
+}
diff --git a/src/apps/marble-maps/Waypoint.qml b/src/apps/marble-maps/Waypoint.qml
index bcf9df6..1310932 100644
--- a/src/apps/marble-maps/Waypoint.qml
+++ b/src/apps/marble-maps/Waypoint.qml
@@ -32,16 +32,16 @@ Item {
id: image
onClicked: {
if (type == "searchResult") {
- if (placemarkDialog.placemark === placemark) {
- placemarkDialog.placemark = null
- itemStack.state = ""
+ if (placemarkDialog.item.placemark === placemark) {
+ placemarkDialog.item.placemark = null
+ dialogContainer.currentIndex = dialogContainer.none
} else {
- placemarkDialog.placemark = placemark
- itemStack.state = "place"
+ placemarkDialog.item.placemark = placemark
+ dialogContainer.currentIndex = dialogContainer.place
}
} else {
- routeEditor.currentIndex = index
- itemStack.state = "routing"
+ routeEditor.item.currentIndex = index
+ dialogContainer.currentIndex = dialogContainer.routing
}
}
anchors {
diff --git a/src/apps/marble-maps/konqi/konqi-app-dev.png b/src/apps/marble-maps/konqi/konqi-app-dev.png
new file mode 100644
index 0000000..b010a58
--- /dev/null
+++ b/src/apps/marble-maps/konqi/konqi-app-dev.png
Binary files differ
diff --git a/src/apps/marble-maps/konqi/konqi-books.png b/src/apps/marble-maps/konqi/konqi-books.png
new file mode 100644
index 0000000..45de86b
--- /dev/null
+++ b/src/apps/marble-maps/konqi/konqi-books.png
Binary files differ
diff --git a/src/apps/marble-maps/konqi/konqi-dev-qt.png b/src/apps/marble-maps/konqi/konqi-dev-qt.png
new file mode 100644
index 0000000..c3fafba
--- /dev/null
+++ b/src/apps/marble-maps/konqi/konqi-dev-qt.png
Binary files differ
diff --git a/src/apps/marble-maps/konqi/konqi-globe.png b/src/apps/marble-maps/konqi/konqi-globe.png
new file mode 100644
index 0000000..bdc96e9
--- /dev/null
+++ b/src/apps/marble-maps/konqi/konqi-globe.png
Binary files differ
diff --git a/src/apps/marble-maps/konqi/konqi-group.png b/src/apps/marble-maps/konqi/konqi-group.png
new file mode 100644
index 0000000..5154aff
--- /dev/null
+++ b/src/apps/marble-maps/konqi/konqi-group.png
Binary files differ