Warning, /education/marble/src/apps/marble-maps/OutdoorActivities.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2017 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 
0006 import QtQuick 2.6
0007 import QtQuick.Window 2.2
0008 import QtQuick.Controls 2.0
0009 import QtQuick.Layouts 1.3
0010 
0011 
0012 Item {
0013     id: root
0014 
0015     implicitHeight: Math.min(0.75 * Screen.height, listView.contentHeight)
0016     property var marbleMaps
0017 
0018     ListModel {
0019         id: transportModel
0020         ListElement {
0021             name: qsTr("Walkways")
0022             icon: "material/directions-walk.svg"
0023             key: "foot"
0024         }
0025         ListElement {
0026             name: qsTr("Hiking Routes")
0027             icon: "thenounproject/hiker.svg"
0028             key: "hiking"
0029         }
0030         ListElement {
0031             name: qsTr("Bicycle Routes")
0032             icon: "material/directions-bike.svg"
0033             key: "bicycle"
0034         }
0035         ListElement {
0036             name: qsTr("Mountainbike Routes")
0037             icon: "thenounproject/mountain-biking.svg"
0038             key: "mountainbike"
0039         }
0040         ListElement {
0041             name: qsTr("Inline Skating Routes")
0042             icon: "thenounproject/inline-skater.svg"
0043             key: "inline-skates"
0044         }
0045         ListElement {
0046             name: qsTr("Bridleways")
0047             icon: "thenounproject/horse-riding.svg"
0048             key: "horse"
0049         }
0050     }
0051 
0052     ListView {
0053         id: listView
0054         anchors.fill: parent
0055         contentWidth: width
0056 
0057         model: transportModel
0058         clip: true
0059         spacing: Screen.pixelDensity * 2
0060 
0061         delegate: Row {
0062             CheckBox {
0063                 id: control
0064                 text: name
0065 
0066                 checked: root.marbleMaps.isRelationTypeVisible(key)
0067 
0068                 contentItem: Row {
0069                     spacing: Screen.pixelDensity * 1
0070 
0071                     Item {
0072                         height: parent.height
0073                         width: control.indicator.width + control.spacing
0074                     }
0075 
0076                     Image {
0077                         source: icon
0078                         height: parent.height
0079                         sourceSize.height: height
0080                         fillMode: Image.PreserveAspectFit
0081                     }
0082 
0083                     Text {
0084                         height: parent.height
0085                         text: control.text
0086                         font: control.font
0087                         opacity: enabled ? 1.0 : 0.3
0088                         horizontalAlignment: Text.AlignHCenter
0089                         verticalAlignment: Text.AlignVCenter
0090                     }
0091                 }
0092 
0093                 onCheckedChanged: {
0094                     root.marbleMaps.setRelationTypeVisible(key, checked)
0095                 }
0096             }
0097         }
0098         ScrollBar.vertical: ScrollBar {}
0099     }
0100 }