diff options
Diffstat (limited to 'app/pages')
-rw-r--r-- | app/pages/DetailPage.qml | 17 | ||||
-rw-r--r-- | app/pages/ListPage.qml | 92 | ||||
-rw-r--r-- | app/pages/ManagementPage.qml | 23 |
3 files changed, 112 insertions, 20 deletions
diff --git a/app/pages/DetailPage.qml b/app/pages/DetailPage.qml index 043714d..45e5202 100644 --- a/app/pages/DetailPage.qml +++ b/app/pages/DetailPage.qml @@ -56,9 +56,22 @@ import QtQuick.Controls 2.0 Item { Layout.preferredWidth: 200 Layout.preferredHeight: 200 - Image { + + Image { + id: imageicon anchors.fill: parent - source: model.icon + source: model.icon != ""?model.icon : 'qrc:/images/blank.svg' + property string initial: model.name.substring(0,1).toUpperCase() + + Label { + style: Text.Outline + styleColor: "#00ADDC" + color: 'transparent' + font.pixelSize: parent.height * 0.5 + anchors.centerIn: parent + text: parent.initial + visible: model.icon == "" + } } } diff --git a/app/pages/ListPage.qml b/app/pages/ListPage.qml index f4b78da..c9116d4 100644 --- a/app/pages/ListPage.qml +++ b/app/pages/ListPage.qml @@ -35,6 +35,14 @@ Page { implicitHeight: 60 running: false } + BusyIndicator { + id: nextBusyIndicator + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + implicitWidth: 60 + implicitHeight: 60 + running: false + } StackView { id: stack @@ -58,21 +66,35 @@ Page { anchors.fill: parent Item { - Layout.preferredWidth: 100 - Layout.preferredHeight: 100 + Layout.preferredWidth: 80 + Layout.preferredHeight: 80 MouseArea{ anchors.fill: parent z: 2 - onClicked: { - stack.push("qrc:/pages/DetailPage.qml", {stack: stack, model: model}, StackView.Immediate) + onClicked: { + stack.push("qrc:/pages/DetailPage.qml", {stack: stack, model: model}, StackView.Immediate) } } + Image { + id: imageicon anchors.fill: parent - source: model.icon + source: model.icon != ""?model.icon : 'qrc:/images/blank.svg' + property string initial: model.name.substring(0,1).toUpperCase() + + Label { + style: Text.Outline + styleColor: "#00ADDC" + color: 'transparent' + font.pixelSize: parent.height * 0.5 + anchors.centerIn: parent + text: parent.initial + visible: model.icon == "" + } } } + ColumnLayout { Label { Layout.fillWidth: true @@ -96,9 +118,10 @@ Page { ColumnLayout { spacing: 5 Layout.alignment: Qt.AlignRight | Qt.AlignVCenter - + Button { - x: x - 6 + anchors.right: parent.right + anchors.rightMargin: 6 text: model.statetext onClicked: { if (model.statetext === 'Install' || model.statetext === 'Update') { @@ -113,11 +136,10 @@ Page { } implicitWidth: 140 implicitHeight: 40 - //Layout.rightMargin: 5 } } - } + DownloadBar { anchors.fill: parent progress: model.progress @@ -134,12 +156,19 @@ Page { states: [ State { - name: "prevPageState"; when: listView.contentY < -nPullHeight + name: "prevPageState"; when: (prevBusyIndicator.running == false) && listView.contentY < -nPullHeight StateChangeScript { name: "prevPageScript" script: getPrevPage() } - } + }, + State { + name: "nextPageState"; when: appSize > 8 && (nextBusyIndicator.running == false) && (listView.contentHeight > 0) && (listView.contentY > (listView.contentHeight - listView.height + nPullHeight)) + StateChangeScript { + name: "nextPageScript" + script: getNextPage() + } + } ] } @@ -147,10 +176,18 @@ Page { listView.y = nPullHeight; currentPageIndex = currentPageIndex > 0 ? currentPageIndex-1 : 0; - prevBusyIndicator.running = true + prevBusyIndicator.running = true; prevPageTimer.start(); } + function getNextPage() { + listView.y = nPullHeight; + + currentPageIndex++; + nextBusyIndicator.running = true; + nextPageTimer.start(); + } + Timer { id: prevPageTimer interval: 1000 @@ -162,6 +199,16 @@ Page { } } + Timer { + id: nextPageTimer + interval: 1000 + repeat: false + running: false + onTriggered: { + listView.model.getNextPage(currentPageIndex) + nextPageAnimation.start(); + } + } NumberAnimation { id: prevPageAnimation target: listView @@ -171,16 +218,33 @@ Page { to: 0 onStopped: { prevBusyIndicator.running = false - listView.y = 0; + //listView.y = 0; } } + NumberAnimation { + id: nextPageAnimation + target: listView + property: "y" + duration: 100 + from: nPullHeight + to: 0 + onStopped: { + nextBusyIndicator.running = false + //listView.y = 0; + } + } Connections { target: listView.model onRequestCompleted: { appSize = appsize pageSize = pagesize - console.log("request completed!", appSize, pageSize) + console.log("request completed!", appSize, pageSize, currentPageIndex) + if(appSize == 0 && currentPageIndex > 0) { + listView.model.getPrevPage(--currentPageIndex) + }else{ + listView.y = 0; + } } } } diff --git a/app/pages/ManagementPage.qml b/app/pages/ManagementPage.qml index 9a4cf31..e445c63 100644 --- a/app/pages/ManagementPage.qml +++ b/app/pages/ManagementPage.qml @@ -47,9 +47,22 @@ Page { Item { Layout.preferredWidth: 100 Layout.preferredHeight: 100 - Image { + + Image { + id: imageicon anchors.fill: parent - source: 'file://' + model.icon + source: model.icon != ""?'file://' + model.icon : 'qrc:/images/blank.svg' + property string initial: model.name.substring(0,1).toUpperCase() + + Label { + style: Text.Outline + styleColor: "#00ADDC" + color: 'transparent' + font.pixelSize: parent.height * 0.5 + anchors.centerIn: parent + text: parent.initial + visible: model.icon == "" + } } } ColumnLayout { @@ -77,7 +90,8 @@ Page { Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Button { - x: x - 6 + anchors.right: parent.right + anchors.rightMargin: 6 text: 'Launch' onClicked: { if (listView.model.launch(model.id) > 1) { @@ -90,7 +104,8 @@ Page { implicitHeight: 40 } Button { - x: x - 6 + anchors.right: parent.right + anchors.rightMargin: 6 visible: model.name.toUpperCase() != "HOMESCREEN" && model.name.toUpperCase() != "LAUNCHER" text: 'Uninstall' onClicked: { |