X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=psa_harmattan%2Ffeedingit%2Fdeb_dist%2Ffeedingit-0.1.0%2Fqml%2FArticleViewer.qml;h=9bb29b479c43d23a3c2fc675ef08159b24073ad7;hb=6326074bd36e9d145c13ecdc42e01e1f4babe9de;hp=f974ddb33fabbd6ab3814ba8a7a1da12358fb5a9;hpb=4d62c2b3db1336832e024ccb25747126abf4e4c1;p=feedingit diff --git a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/ArticleViewer.qml b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/ArticleViewer.qml index f974ddb..9bb29b4 100644 --- a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/ArticleViewer.qml +++ b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/qml/ArticleViewer.qml @@ -1,4 +1,5 @@ import Qt 4.7 +import com.nokia.meego 1.0 Item { id: articleViewer @@ -56,9 +57,12 @@ Item { id: articleList; /*model: visualModel.parts.list;*/ z: 6 model: articles delegate: listing - width: parent.width; height: parent.height; /*x: 0;*/ + width: parent.width; + height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; + /*x: 0;*/ cacheBuffer: 100; flickDeceleration: 1500 + visible: articles.status==XmlListModel.Ready } ListView { @@ -66,7 +70,9 @@ Item { model: articles; delegate: viewer orientation: ListView.Horizontal - width: parent.width; height: parent.height; visible: false; z:8 + width: parent.width; + height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height; + visible: false; z:8 //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem //cacheBuffer: 5; @@ -75,19 +81,43 @@ Item { highlightMoveDuration: 300; } + ProgressBar { + id: updateBar + minimumValue: 0 + maximumValue: 100 + value: window.updateProgressValue + visible: window.isUpdateInProgress + width: parent.width + anchors.bottom: parent.bottom + } + Rectangle { id: noArticle //width: parent.width; height: parent.height; - //color: "#000000" - anchors.centerIn: parent; + color: "black" + opacity: 0.8 + + //anchors.centerIn: parent; + anchors.fill: parent visible: false; z:8; - Text { id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); } - Image { id: loadingImage; anchors.centerIn: parent; source: "common/images/loading.png"; - height: 96; width: 96; - NumberAnimation on rotation { - from: 0; to: 360; running: (loadingImage.visible == true); loops: Animation.Infinite; duration: 900 - } + Text { + id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); + font.pixelSize: settings.mainTextSize + } + + BusyIndicator { + id: loadingIndicator + anchors.centerIn: parent; + running: visible + visible: false + platformStyle: BusyIndicatorStyle { size: "large" } + } + + MouseArea { + // Disable clicks when this item is visible + anchors.fill: parent + enabled: parent.visible } states: [ State { @@ -96,14 +126,21 @@ Item { PropertyChanges { target: loadingImage; visible: false; } PropertyChanges { target: noText; visible: true; } }, State { - name: "loading"; when: articles.count==0 && articles.status != XmlListModel.Ready + name: "loading"; when: articles.status != XmlListModel.Ready PropertyChanges { target: noArticle; visible: true; } PropertyChanges { target: noText; visible: false; } - PropertyChanges { target: loadingImage; visible: true; } + PropertyChanges { target: loadingIndicator; visible: true; } } ] } + Rectangle { + id: reloading + visible: articles.status != XmlListModel.Ready + + + } + Component { id: listing; @@ -123,11 +160,12 @@ Item { width: listItem.width - 6; anchors.margins: 5 - verticalAlignment: Text.AlignVCenter; text: title; + verticalAlignment: Text.AlignVCenter; + text: title; color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour; wrapMode: Text.WordWrap; font.bold: false; - font.pointSize: 18 + font.pixelSize: settings.mainTextSize } MouseArea { anchors.fill: listItem; onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; } @@ -142,7 +180,7 @@ Item { id: flipItem; width: articleViewer.width; height: articleViewer.height; - property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: ""; + //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: ""; property string html: controller.getArticle(articleViewer.feedid, articleid) ArticleDisplay { zoomEnabled: articleViewer.zoomEnabled; @@ -154,15 +192,10 @@ Item { StateChangeScript { name: "myScript" script: { - flipItem.url=path; + //flipItem.url=path; controller.setEntryRead(articleViewer.feedid, articleid) } } - }, State { - name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2; - StateChangeScript { - script: { flipItem.url=path; } - } } ] } @@ -182,5 +215,4 @@ Item { XmlRole { name: "unread"; query: "unread/string()"; isKey: true} } - }