Changeset View
Changeset View
Standalone View
Standalone View
src/apps/marble-maps/IndoorLevelSelector.qml
- This file was added.
1 | // | ||||
---|---|---|---|---|---|
2 | // This file is part of the Marble Virtual Globe. | ||||
3 | // | ||||
4 | // This program is free software licensed under the GNU LGPL. You can | ||||
5 | // find a copy of this license in LICENSE.txt in the top directory of | ||||
6 | // the source code. | ||||
7 | // | ||||
8 | // Copyright 2017 Mohammed Nafees <nafees.technocool@gmail.com> | ||||
9 | // | ||||
10 | | ||||
11 | import QtQuick 2.7 | ||||
12 | import QtQuick.Controls 2.0 | ||||
13 | import QtQuick.Layouts 1.0 | ||||
14 | import QtQuick.Controls.Material 2.1 | ||||
15 | | ||||
16 | import org.kde.marble 0.20 | ||||
17 | | ||||
18 | Item { | ||||
19 | id: root | ||||
20 | | ||||
21 | property var marbleItem: null | ||||
22 | | ||||
23 | IndoorLevelsBackend { | ||||
24 | id: indoorBackend | ||||
25 | marbleQuickItem: root.marbleItem | ||||
26 | } | ||||
27 | | ||||
28 | Pane { | ||||
29 | id: container | ||||
30 | width: 50 | ||||
31 | height: containerLayout.implicitHeight | ||||
32 | anchors.fill: parent | ||||
33 | padding: 0.0 | ||||
34 | | ||||
35 | Material.elevation: 1 | ||||
36 | | ||||
37 | ColumnLayout { | ||||
38 | id: containerLayout | ||||
39 | spacing: 0.0 | ||||
40 | | ||||
41 | Repeater { | ||||
42 | model: indoorBackend.levels() | ||||
43 | Rectangle { | ||||
44 | height: 50 | ||||
45 | width: 50 | ||||
46 | | ||||
47 | MouseArea { | ||||
48 | anchors.fill: parent | ||||
49 | | ||||
50 | Label { | ||||
51 | text: indoorBackend.levels()[index].level | ||||
52 | font.pixelSize: 20 | ||||
53 | anchors.centerIn: parent | ||||
54 | } | ||||
55 | | ||||
56 | onClicked: indoorBackend.setCurrentLevel(indoorBackend.levels()[index].value) | ||||
57 | } | ||||
58 | } | ||||
59 | } | ||||
60 | } | ||||
61 | } | ||||
62 | } |