X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreenNG%2Fqml%2FShortcutArea.qml;fp=HomeScreenNG%2Fqml%2FShortcutArea.qml;h=a98bec241862d120f1f9b21cc0dd3aff33538969;hb=6bf5bbd0ab5abab05305667a516c069c7c5556f4;hp=0000000000000000000000000000000000000000;hpb=505ec164e5174ddd838c0cac1e3e828930cb3b50;p=staging%2FHomeScreen.git 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) + } + } + } + } +}