diff options
author | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2016-12-02 11:19:51 +0900 |
---|---|---|
committer | Tasuku Suzuki <tasuku.suzuki@qt.io> | 2016-12-02 13:14:55 +0900 |
commit | 6bf5bbd0ab5abab05305667a516c069c7c5556f4 (patch) | |
tree | f2cf3278c383771ff1b40dae2c72b0f08fdd69ef /HomeScreenNG/qml/ShortcutArea.qml | |
parent | 505ec164e5174ddd838c0cac1e3e828930cb3b50 (diff) |
WIP: add Qt Quick HomeScreen UI
Change-Id: I2be964f6d9e76df616169d7b2654d17ae9446687
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'HomeScreenNG/qml/ShortcutArea.qml')
-rw-r--r-- | HomeScreenNG/qml/ShortcutArea.qml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/HomeScreenNG/qml/ShortcutArea.qml b/HomeScreenNG/qml/ShortcutArea.qml new file mode 100644 index 0000000..a98bec2 --- /dev/null +++ b/HomeScreenNG/qml/ShortcutArea.qml @@ -0,0 +1,53 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.1 +import HomeScreen 1.0 + +Item { + id: root + width: 785 + height: 218 + + ApplicationLauncher { + id: launcher + } + + ListModel { + id: applicationModel + ListElement { + name: 'Home' + application: 'launcher' + } + ListElement { + name: 'Multimedia' + application: 'musicplayer' + } + ListElement { + name: 'HVAC' + application: 'hvac' + } + ListElement { + name: 'Navigation' + application: 'navigation' + } + } + + property int currentIndex: -1 // TODO: to be moved to whereever right + + RowLayout { + anchors.fill: parent + spacing: 2 + Repeater { + model: applicationModel + delegate: ShortcutIcon { + Layout.fillWidth: true + Layout.fillHeight: true + name: model.name + active: model.index === root.currentIndex + onClicked: { + root.currentIndex = active ? -1 : model.index + launcher.launch(model.application) + } + } + } + } +} |