diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-08-27 19:45:41 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-10-06 18:37:22 +0200 |
commit | 15f2efc9aa77893d5300d198dd3b5c42549018e8 (patch) | |
tree | 35e4f512ec86a770960f786eeddaab1e8b29d929 /gui/components/Locations.qml | |
parent | b8c34672538109a67c1ffc4a4ec4f90772ea9e3e (diff) |
[ui] refactor ui
Diffstat (limited to 'gui/components/Locations.qml')
-rw-r--r-- | gui/components/Locations.qml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gui/components/Locations.qml b/gui/components/Locations.qml new file mode 100644 index 0000000..d3e0f5a --- /dev/null +++ b/gui/components/Locations.qml @@ -0,0 +1,63 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 + +import "../themes/themes.js" as Theme + +Page { + title: qsTr("Select Location") + + ListView { + id: gwList + focus: true + currentIndex: -1 + anchors.fill: parent + spacing: 1 + + delegate: ItemDelegate { + id: loc + Rectangle { + width: parent.width + height: 1 + color: Theme.borderColor + } + width: parent.width + text: model.text + highlighted: ListView.isCurrentItem + icon.color: "transparent" + icon.source: model.icon + onClicked: { + model.triggered() + stackView.pop() + } + MouseArea { + property var onMouseAreaClicked: function () { + parent.clicked() + } + id: mouseArea + anchors.fill: loc + cursorShape: Qt.PointingHandCursor + onReleased: { + onMouseAreaClicked() + } + } + } + + model: ListModel { + ListElement { + text: qsTr("Paris") + triggered: function () {} + icon: "../resources/reception-4.svg" + } + ListElement { + text: qsTr("Montreal") + triggered: function () {} + icon: "../resources/reception-4.svg" + } + ListElement { + text: qsTr("Seattle") + triggered: function () {} + icon: "../resources/reception-2.svg" + } + } + } +} |