Warning, /education/marble/src/apps/behaim/MainScreen.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2015 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 import QtQuick 2.3
0006 import QtQuick.Controls 1.3
0007 import QtQuick.Window 2.2
0008 import QtQuick.Layouts 1.1
0009 
0010 import org.kde.kirigami 2.0 as Kirigami
0011 import org.kde.marble 0.20
0012 
0013 Kirigami.ApplicationWindow {
0014     id: root
0015     Layout.fillWidth: true
0016 
0017 
0018     SystemPalette {
0019         id: palette
0020         colorGroup: SystemPalette.Active
0021     }
0022 
0023     globalDrawer: Kirigami.GlobalDrawer {
0024         id: drawer
0025         title: "Settings"
0026         handleVisible: !aboutDrawer.drawerOpen && !infoDrawer.drawerOpen
0027         topContent: [
0028             CheckBox {
0029                 text: qsTr("Show Behaim places")
0030                 onCheckedChanged: marbleMaps.setPropertyEnabled("cities", checked)
0031             },
0032             CheckBox {
0033                 text: qsTr("Show texts and illustrations")
0034                 onCheckedChanged: marbleMaps.setPropertyEnabled("otherplaces", checked)
0035             },
0036             CheckBox {
0037                 text: qsTr("Show the accurate coastline")
0038                 onCheckedChanged: marbleMaps.setPropertyEnabled("coastlines", checked)
0039             },
0040             Label {
0041                 wrapMode: Text.WordWrap
0042                 text: qsTr("<h4>Globe Variant</h4>")
0043                 Layout.fillWidth: true
0044             },
0045             ExclusiveGroup {
0046                 id: layerGroup
0047                 onCurrentChanged: current.apply()
0048             },
0049             RadioButton {
0050                 text: qsTr("Original (1492)")
0051                 checked: true
0052                 exclusiveGroup: layerGroup
0053                 property string description: qsTr("Digital imagery taken directly from the original Behaim globe.")
0054                 function apply() {
0055                     marbleMaps.setPropertyEnabled("ravenstein", false)
0056                     marbleMaps.setPropertyEnabled("ghillany", false)
0057                 }
0058             },
0059 
0060             RadioButton {
0061                 text: qsTr("Ghillany (1853)")
0062                 property string description: qsTr("A (rough) facsimile created by Friedrich Wilhelm Ghillany in 1853.")
0063                 exclusiveGroup: layerGroup
0064 
0065                 function apply() {
0066                     marbleMaps.setPropertyEnabled("ravenstein", false)
0067                     marbleMaps.setPropertyEnabled("ghillany", true)
0068                 }
0069             },
0070 
0071             RadioButton {
0072                 text: qsTr("Ravenstein (1908)")
0073                 property string description: qsTr("A (rough) facsimile created by Ernest George Ravenstein in 1908.")
0074                 exclusiveGroup: layerGroup
0075                 function apply() {
0076                     marbleMaps.setPropertyEnabled("ghillany", false)
0077                     marbleMaps.setPropertyEnabled("ravenstein", true)
0078                 }
0079             },
0080             Item { width: 1; height: Screen.pixelDensity * 2; }
0081         ]
0082         actions: [
0083             Kirigami.Action {
0084                 text: qsTr("Information")
0085                 onTriggered: {
0086                     infoDrawer.open()
0087                     if(aboutDrawer.drawerOpen){
0088                         aboutDrawer.close()
0089                     }
0090                 }
0091             },
0092             Kirigami.Action {
0093                 text: qsTr("About")
0094                 iconSource: "menu.png"
0095                 onTriggered: {
0096                     aboutDrawer.open()
0097                     if(infoDrawer.drawerOpen){
0098                         infoDrawer.close()
0099                     }
0100                 }
0101             }
0102         ]
0103     }
0104 
0105     Kirigami.Page {
0106         id: page
0107         property alias marbleMaps: mainLayout.marbleMaps
0108         anchors.fill: parent
0109         title: qsTr("Behaim Globe")
0110         visible: true
0111 
0112         property bool landscape: root.width > root.height
0113 
0114         Rectangle {
0115             id: background
0116             anchors.fill: parent
0117             color: palette.base
0118         }
0119 
0120         Grid {
0121             anchors.horizontalCenter: parent.horizontalCenter
0122             anchors.verticalCenter: parent.verticalCenter
0123 
0124             id: mainLayout
0125             property alias marbleMaps: mapItem.marbleMaps
0126             columns: root.landscape ? 2 : 1
0127             columnSpacing: 0
0128             rows: root.landscape ? 1 : 2
0129             rowSpacing: 0
0130             layoutDirection: root.landscape ? Qt.RightToLeft : Qt.LeftToRight
0131 
0132             Item {
0133                 id: mapItem
0134                 property alias marbleMaps: pinchArea.marbleItem
0135                 width: root.width
0136                 height: root.height
0137 
0138                 Rectangle {
0139                     color: "black"
0140                     anchors.fill: parent
0141                 }
0142 
0143                 PinchArea {
0144                     id: pinchArea
0145                     anchors.fill: parent
0146                     enabled: true
0147                     property alias marbleItem: marbleMaps
0148                     onPinchStarted: marbleMaps.handlePinchStarted(pinch.center)
0149                     onPinchFinished: marbleMaps.handlePinchFinished(pinch.center)
0150                     onPinchUpdated: marbleMaps.handlePinchUpdated(pinch.center, pinch.scale);
0151 
0152                     MarbleItem {
0153                         id: marbleMaps
0154                         anchors.fill: parent
0155 
0156                         focus: true
0157                         zoom: 1150
0158                         inertialGlobeRotation: true
0159 
0160                         // Theme settings.
0161                         projection: MarbleItem.Spherical
0162                         mapThemeId: "earth/behaim1492/behaim1492.dgml"
0163 
0164                         // Visibility of layers/plugins.
0165                         showFrameRate: false
0166                         showAtmosphere: true
0167                         showCompass: false
0168                         showClouds: false
0169                         showCrosshairs: false
0170                         showGrid: false
0171                         showOverviewMap: false
0172                         showOtherPlaces: false
0173                         showScaleBar: false
0174                         showBackground: true
0175                         showPositionMarker: false
0176 
0177                         Component.onCompleted: {
0178                             setPluginSetting("stars", "renderConstellationLines", "false");
0179                             setPluginSetting("stars", "renderConstellationLabels", "false");
0180                             setPluginSetting("stars", "renderDsoLabels", "false");
0181                             setPluginSetting("stars", "viewSolarSystemLabel", "false");
0182                             setPluginSetting("stars", "zoomSunMoon", "false");
0183                             setPluginSetting("stars", "renderEcliptic", "false");
0184                             setPluginSetting("stars", "renderCelestialEquator", "false");
0185                             setPluginSetting("stars", "renderCelestialPole", "false");
0186                             marbleMaps.forceActiveFocus()
0187                         }
0188 
0189                     }
0190                 }
0191             }
0192         }
0193 
0194         Kirigami.OverlayDrawer {
0195             id: infoDrawer
0196             edge: Qt.BottomEdge
0197 
0198             contentItem: Item {
0199                 Layout.fillWidth: true
0200                 implicitHeight: columnLayoutInfo.text.height + Kirigami.Units.gridUnit
0201                 ColumnLayout {
0202                     id: columnLayoutInfo
0203                     property alias text: flickableInfo.text
0204                     anchors.fill: parent
0205                     Flickable {
0206                         id: flickableInfo
0207                         property alias text: infoText
0208                         anchors.fill: parent
0209                         contentWidth: infoText.width
0210                         contentHeight: infoText.height
0211                         flickableDirection: Flickable.VerticalFlick
0212                         clip: true
0213 
0214                         Text {
0215                             id: infoText
0216                             text: qsTr("<h3>Martin Behaim's Erdapfel</h3>\
0217                                <p>The oldest existent globe of the Earth.\
0218                                Martin Behaim and collaborators created the globe around 1492 at the time of \
0219                                <a href=\"https://en.wikipedia.org/wiki/Voyages_of_Christopher_Columbus\">Columbus'</a> first sea travel to the west.\
0220                                Hence the American continent is missing on this globe.\
0221                                Also note the detailed inscriptions in early modern German.</p>\
0222                                <p>Please see <a href=\"https://en.wikipedia.org/wiki/Erdapfel\">Wikipedia: Erdapfel</a> \
0223                                for further information about the Behaim globe.")
0224                             width: columnLayoutInfo.width
0225                             wrapMode: Text.WordWrap
0226                             onLinkActivated: Qt.openUrlExternally(link)
0227                         }
0228                     }
0229                     Item {
0230                         Layout.minimumHeight: Kirigami.Units.gridUnit * 4
0231                     }
0232                 }
0233             }
0234         }
0235 
0236         Kirigami.OverlayDrawer {
0237             id: aboutDrawer
0238             edge: Qt.BottomEdge
0239             contentItem: Item {
0240                 Layout.fillWidth: true
0241                 implicitHeight: columnLayoutInfo.text.height + Kirigami.Units.gridUnit
0242 
0243                 ColumnLayout {
0244                     id: columnLayoutAbout
0245                     property alias text: flickableAbout.text
0246                     anchors.fill: parent
0247                     Flickable {
0248                         id: flickableAbout
0249                         property alias text: aboutText
0250                         anchors.fill: parent
0251                         contentWidth: aboutText.width
0252                         contentHeight: aboutText.height
0253                         flickableDirection: Flickable.VerticalFlick
0254                         clip: true
0255                         Text {
0256                             id: aboutText
0257                             anchors {
0258                                 margins: Screen.pixelDensity * 2
0259                                 topMargin: Screen.pixelDensity * 14
0260                             }
0261                             text: qsTr("<h3>Germanisches Nationalmuseum</h3>\
0262                            <p>The original Behaim globe can be visited in the
0263                            <a href=\"https://www.gnm.de/\">Germanisches Nationalmuseum</a> in Nuremberg, Germany.</p>\
0264                            <h3>KDE Marble</h3>\
0265                            <p>This app is part of the <a href=\"https://marble.kde.org\">Marble</a> project.\
0266                            The Marble community works on maps and virtual globes with the goal to produce visually appealing, easy-to-use Free Software.</p>\
0267                            <h3>Map Content</h3>\
0268                            <p>Digitized map based on orthophotographic gores by TU Vienna, 1990. Germanisches Nationalmuseum and\
0269                            Friedrich-Alexander-Universität Erlangen-Nürnberg, CC BY-SA 3.0.\
0270                            Ghillany map based on two planiglobes which are provided as a map supplement\
0271                            to F.W. Ghillany's \"Geschichte des Seefahrers Ritter Martin Behaim nach den ältesten vorhandenen Urkunden\",\
0272                            Nuremberg 1853. CC BY-SA 3.0.</p>")
0273                             width: columnLayoutAbout.width
0274                             wrapMode: Text.WordWrap
0275                             onLinkActivated: Qt.openUrlExternally(link)
0276                         }
0277                     }
0278 
0279                 }
0280             }
0281         }
0282     }
0283 }
0284 
0285