import QtQuick 2.1 import QtQuick.Controls 2.0 as Controls import org.kde.kirigami 2.4 as Kirigami import QtQuick.Layouts 1.2 import Qt.labs.settings 1.0 import "qrc:js/functions.js" as ManifoldJS Kirigami.ScrollablePage { id: pageRoot title: qsTr("Welcome!") /* Load pages */ Component {id: feedPage; FeedPage {}} Component {id: maniphestPage; ManiphestPage {}} Component {id: macroPage; MacroPage {}} Component {id: testPage; TestPage {}} Component {id: settingsPage; SettingsPage {}} /* Load settings in a vain attempt to get pageStack.initialPage to work, currently still doesn't (see below) */ Settings { id: settings property string phab_url: "https://phabricator.example.com" property string api_token: "api-aaaaaaaaaaaaaaaaaaaaaaaaaaaa" } // Kirigami.PagePool { // id: mainPagePool // } GridView { id: mainListView anchors.fill: parent currentIndex: -1 //currentIndex has focus, openPageIndex is the one actually open now activeFocusOnTab: true focus: true model: ListModel { id: model ListElement { title: "Feed" details: "News feed of goings-on on your Phabricator instance" page: "qrc:/qml/FeedPage.qml" } ListElement { title: "Maniphest Tasks" details: "List of open tasks in Maniphest" page: "qrc:/qml/ManiphestPage.qml" } } delegate: Kirigami.AbstractCard { id: listItem //Accessible.role: Accessible.MenuItem contentItem: Item { GridLayout { // Lets just cargo cult some stuff for now id: delegateLayout anchors { //left: parent.left //top: parent.top //right: parent.right //IMPORTANT: never put the bottom margin, don't know why though it doesn't seem to make a difference? //bottom: parent.bottom } rowSpacing: Kirigami.Units.largeSpacing columnSpacing: Kirigami.Units.largeSpacing columns: width > Kirigami.Units.gridUnit * 20 ? 4 : 2 Kirigami.Icon { source: "qrc:/org/kde/kirigami/applications-graphics.svg" Layout.fillHeight: true Layout.maximumHeight: Kirigami.Units.iconSizes.huge //Layout.preferredWidth: height } ColumnLayout { Kirigami.Heading { level: 2 text: title } Kirigami.Separator { Layout.fillWidth: true } Controls.Label { Layout.fillWidth: true wrapMode: Text.WordWrap text: details } } Controls.Button { Layout.alignment: Qt.AlignRight|Qt.AlignVCenter Layout.columnSpan: 2 text: "Open" onClicked: pageStack.replace(page) } } } } } }