diff --git a/src/apps/behaim/CMakeLists.txt b/src/apps/behaim/CMakeLists.txt --- a/src/apps/behaim/CMakeLists.txt +++ b/src/apps/behaim/CMakeLists.txt @@ -51,6 +51,8 @@ set(ANDROID_NDK_ROOT $ENV{ANDROID_NDK_ROOT}) set(QT_ANDROID_APP_PATH "${ABSOLUTE_INSTALL_PATH}/libs/${ANDROID_ABI}/libMarbleBehaim.so") set(QT_ANDROID_APP_EXTRA_LIBS "${ABSOLUTE_INSTALL_PATH}/lib/libastro.so,${ABSOLUTE_INSTALL_PATH}/lib/libmarblewidget-qt5.so,${ABSOLUTE_INSTALL_PATH}/lib/libmarbledeclarative.so") + set(QML_ROOT_PATH "${ABSOLUTE_INSTALL_PATH}/") + set(QT_ANDROID_APP_EXTRA_PLUGINS "${ABSOLUTE_INSTALL_PATH}//share,${ABSOLUTE_INSTALL_PATH}//lib/qml") set(QT_ANDROID_APP_PACKAGE_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/package") set(QT_ANDROID_APP_PACKAGE_NAME "org.kde.marble.behaim") set(QT_ANDROID_APP_NAME "Marble Globe: Behaim's Erdapfel") diff --git a/src/apps/behaim/MainScreen.qml b/src/apps/behaim/MainScreen.qml --- a/src/apps/behaim/MainScreen.qml +++ b/src/apps/behaim/MainScreen.qml @@ -7,135 +7,284 @@ // // Copyright 2015 Dennis Nienhüser // - - import QtQuick 2.3 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 +import org.kde.kirigami 2.0 as Kirigami import org.kde.marble 0.20 -ApplicationWindow { +Kirigami.ApplicationWindow { id: root - title: qsTr("Behaim Globe") - visible: true - - width: 600 - height: 400 + Layout.fillWidth: true - property bool landscape: root.width > root.height SystemPalette { id: palette colorGroup: SystemPalette.Active } - Rectangle { - id: background - anchors.fill: parent - color: palette.window + globalDrawer: Kirigami.GlobalDrawer { + id: drawer + title: "Settings" + handleVisible: !aboutDrawer.drawerOpen && !infoDrawer.drawerOpen + topContent: [ + CheckBox { + text: qsTr("Show Behaim places") + onCheckedChanged: marbleMaps.setPropertyEnabled("cities", checked) + }, + CheckBox { + text: qsTr("Show texts and illustrations") + onCheckedChanged: marbleMaps.setPropertyEnabled("otherplaces", checked) + }, + CheckBox { + text: qsTr("Show the accurate coastline") + onCheckedChanged: marbleMaps.setPropertyEnabled("coastlines", checked) + }, + Label { + wrapMode: Text.WordWrap + text: qsTr("

Globe Variant

") + Layout.fillWidth: true + }, + ExclusiveGroup { + id: layerGroup + onCurrentChanged: current.apply() + }, + RadioButton { + text: qsTr("Original (1492)") + checked: true + exclusiveGroup: layerGroup + property string description: qsTr("Digital imagery taken directly from the original Behaim globe.") + function apply() { + marbleMaps.setPropertyEnabled("ravenstein", false) + marbleMaps.setPropertyEnabled("ghillany", false) + } + }, + + RadioButton { + text: qsTr("Ghillany (1853)") + property string description: qsTr("A (rough) facsimile created by Friedrich Wilhelm Ghillany in 1853.") + exclusiveGroup: layerGroup + + function apply() { + marbleMaps.setPropertyEnabled("ravenstein", false) + marbleMaps.setPropertyEnabled("ghillany", true) + } + }, + + RadioButton { + text: qsTr("Ravenstein (1908)") + property string description: qsTr("A (rough) facsimile created by Ernest George Ravenstein in 1908.") + exclusiveGroup: layerGroup + function apply() { + marbleMaps.setPropertyEnabled("ghillany", false) + marbleMaps.setPropertyEnabled("ravenstein", true) + } + }, + Item { width: 1; height: Screen.pixelDensity * 2; } + ] + actions: [ + Kirigami.Action { + text: "Information" + onTriggered: { + infoDrawer.open() + if(aboutDrawer.drawerOpen){ + aboutDrawer.close() + } + } + }, + Kirigami.Action { + text: "About" + iconSource: "menu.png" + onTriggered: { + aboutDrawer.open() + if(infoDrawer.drawerOpen){ + infoDrawer.close() + } + } + } + ] } - Grid { - id: mainLayout - columns: root.landscape ? 2 : 1 - columnSpacing: 0 - rows: root.landscape ? 1 : 2 - rowSpacing: 0 - layoutDirection: root.landscape ? Qt.RightToLeft : Qt.LeftToRight + Kirigami.Page { + id: page + property alias marbleMaps: mainLayout.marbleMaps + anchors.fill: parent + title: qsTr("Behaim Globe") + visible: true - Item { - id: mapItem + property bool landscape: root.width > root.height - width: root.landscape ? root.width - infoItem.width : root.width - height: root.landscape ? root.height : root.height - infoItem.height + Rectangle { + id: background + anchors.fill: parent + color: palette.base + } - Rectangle { - color: "black" - anchors.fill: parent - } + Grid { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter - PinchArea { - anchors.fill: parent - enabled: true + id: mainLayout + property alias marbleMaps: mapItem.marbleMaps + columns: root.landscape ? 2 : 1 + columnSpacing: 0 + rows: root.landscape ? 1 : 2 + rowSpacing: 0 + layoutDirection: root.landscape ? Qt.RightToLeft : Qt.LeftToRight - onPinchStarted: marbleMaps.handlePinchStarted(pinch.center) - onPinchFinished: marbleMaps.handlePinchFinished(pinch.center) - onPinchUpdated: marbleMaps.handlePinchUpdated(pinch.center, pinch.scale); + Item { + id: mapItem + property alias marbleMaps: pinchArea.marbleItem + width: root.width + height: root.height - MarbleItem { - id: marbleMaps + Rectangle { + color: "black" anchors.fill: parent + } + + PinchArea { + id: pinchArea + anchors.fill: parent + enabled: true + property alias marbleItem: marbleMaps + onPinchStarted: marbleMaps.handlePinchStarted(pinch.center) + onPinchFinished: marbleMaps.handlePinchFinished(pinch.center) + onPinchUpdated: marbleMaps.handlePinchUpdated(pinch.center, pinch.scale); + + MarbleItem { + id: marbleMaps + anchors.fill: parent + + focus: true + zoom: 1150 + inertialGlobeRotation: true + + // Theme settings. + projection: MarbleItem.Spherical + mapThemeId: "earth/behaim1492/behaim1492.dgml" + + // Visibility of layers/plugins. + showFrameRate: false + showAtmosphere: true + showCompass: false + showClouds: false + showCrosshairs: false + showGrid: false + showOverviewMap: false + showOtherPlaces: false + showScaleBar: false + showBackground: true + showPositionMarker: false + + Component.onCompleted: { + setPluginSetting("stars", "renderConstellationLines", "false"); + setPluginSetting("stars", "renderConstellationLabels", "false"); + setPluginSetting("stars", "renderDsoLabels", "false"); + setPluginSetting("stars", "viewSolarSystemLabel", "false"); + setPluginSetting("stars", "zoomSunMoon", "false"); + setPluginSetting("stars", "renderEcliptic", "false"); + setPluginSetting("stars", "renderCelestialEquator", "false"); + setPluginSetting("stars", "renderCelestialPole", "false"); + marbleMaps.forceActiveFocus() + } - focus: true - zoom: 1150 - inertialGlobeRotation: true - - // Theme settings. - projection: MarbleItem.Spherical - mapThemeId: "earth/behaim1492/behaim1492.dgml" - - // Visibility of layers/plugins. - showFrameRate: false - showAtmosphere: true - showCompass: false - showClouds: false - showCrosshairs: false - showGrid: false - showOverviewMap: false - showOtherPlaces: false - showScaleBar: false - showBackground: true - showPositionMarker: false - - Component.onCompleted: { - setPluginSetting("stars", "renderConstellationLines", "false"); - setPluginSetting("stars", "renderConstellationLabels", "false"); - setPluginSetting("stars", "renderDsoLabels", "false"); - setPluginSetting("stars", "viewSolarSystemLabel", "false"); - setPluginSetting("stars", "zoomSunMoon", "false"); - setPluginSetting("stars", "renderEcliptic", "false"); - setPluginSetting("stars", "renderCelestialEquator", "false"); - setPluginSetting("stars", "renderCelestialPole", "false"); } } + } + } - Button { - id: minimizeLandscapeButton - visible: root.landscape - anchors.left: marbleMaps.left - anchors.top: marbleMaps.top - anchors.leftMargin: Screen.pixelDensity * (infoItem.minimized ? 0.5 : 1.5) - anchors.topMargin: Screen.pixelDensity * 0.5 - iconSource: "menu.png" - onClicked: infoItem.minimized = !infoItem.minimized - } + Kirigami.OverlayDrawer { + id: infoDrawer + edge: Qt.BottomEdge - Button { - id: minimizePortraitButton - visible: !root.landscape - anchors.right: marbleMaps.right - anchors.bottom: marbleMaps.bottom - anchors.rightMargin: Screen.pixelDensity * 0.5 - anchors.bottomMargin: Screen.pixelDensity * (infoItem.minimized ? 0.5 : 1.5) - iconSource: "menu.png" - onClicked: infoItem.minimized = !infoItem.minimized + contentItem: Item { + Layout.fillWidth: true + implicitHeight: columnLayoutInfo.text.height + Kirigami.Units.gridUnit + ColumnLayout { + id: columnLayoutInfo + property alias text: flickableInfo.text + anchors.fill: parent + Flickable { + id: flickableInfo + property alias text: infoText + anchors.fill: parent + contentWidth: infoText.width + contentHeight: infoText.height + flickableDirection: Flickable.VerticalFlick + clip: true + + Text { + id: infoText + text: qsTr("

Martin Behaim's Erdapfel

\ +

The oldest existent globe of the Earth.\ + Martin Behaim and collaborators created the globe around 1492 at the time of \ + Columbus' first sea travel to the west.\ + Hence the American continent is missing on this globe.\ + Also note the detailed inscriptions in early modern German.

\ +

Please see Wikipedia: Erdapfel \ + for further information about the Behaim globe.") + width: columnLayoutInfo.width + wrapMode: Text.WordWrap + onLinkActivated: Qt.openUrlExternally(link) + } + } + Item { + Layout.minimumHeight: Kirigami.Units.gridUnit * 4 + } } } } - Item { - id: infoItem - property bool minimized: false - width: root.landscape ? (minimized ? 0 : root.width / 2.5) : root.width - height: root.landscape ? root.height : (minimized ? 0 : root.height / 2.5) + Kirigami.OverlayDrawer { + id: aboutDrawer + edge: Qt.BottomEdge + contentItem: Item { + Layout.fillWidth: true + implicitHeight: columnLayoutInfo.text.height + Kirigami.Units.gridUnit - Legend { - id: legend - anchors.fill: parent - visible: !infoItem.minimized + ColumnLayout { + id: columnLayoutAbout + property alias text: flickableAbout.text + anchors.fill: parent + Flickable { + id: flickableAbout + property alias text: aboutText + anchors.fill: parent + contentWidth: aboutText.width + contentHeight: aboutText.height + flickableDirection: Flickable.VerticalFlick + clip: true + Text { + id: aboutText + anchors { + margins: Screen.pixelDensity * 2 + topMargin: Screen.pixelDensity * 14 + } + text: qsTr("

Germanisches Nationalmuseum

\ +

The original Behaim globe can be visited in the + Germanisches Nationalmuseum in Nuremberg, Germany.

\ +

KDE Marble

\ +

This app is part of the Marble project.\ + The Marble community works on maps and virtual globes with the goal to produce visually appealing, easy-to-use Free Software.

\ +

Map Content

\ +

Digitized map based on orthophotographic gores by TU Vienna, 1990. Germanisches Nationalmuseum and\ + Friedrich-Alexander-Universität Erlangen-Nürnberg, CC BY-SA 3.0.\ + Ghillany map based on two planiglobes which are provided as a map supplement\ + to F.W. Ghillany's \"Geschichte des Seefahrers Ritter Martin Behaim nach den ältesten vorhandenen Urkunden\",\ + Nuremberg 1853. CC BY-SA 3.0.

") + width: columnLayoutAbout.width + wrapMode: Text.WordWrap + onLinkActivated: Qt.openUrlExternally(link) + } + } + + } } } } } + + diff --git a/src/apps/behaim/package/deploy-behaim.json.in b/src/apps/behaim/package/deploy-behaim.json.in --- a/src/apps/behaim/package/deploy-behaim.json.in +++ b/src/apps/behaim/package/deploy-behaim.json.in @@ -12,5 +12,7 @@ "android-package": "@QT_ANDROID_APP_PACKAGE_NAME@", "android-app-name": "@QT_ANDROID_APP_NAME@", "android-extra-libs": "@QT_ANDROID_APP_EXTRA_LIBS@", + "qml-root-path": "@QML_ROOT_PATH@", + "android-extra-plugins": "@QT_ANDROID_APP_EXTRA_PLUGINS@", "android-package-source-directory": "@QT_ANDROID_APP_PACKAGE_SOURCE_ROOT@" }