PageStackWindow {
+ id: window
initialPage: categoryPage
+ signal articleClosed()
+ property string feedid
+ property string catid
+
ToolBarLayout {
id: commonTools
visible: false
id: myMenu
visualParent: pageStack
MenuLayout {
+ MenuItem { text: qsTr("Settings"); onClicked: {} }
+ MenuItem { text: qsTr("Update All Categories"); visible: pageStack.depth==3; onClicked: controller.updateAll(); }
+ MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
+ }
+ }
+
+ Menu {
+ id: myFeedsMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("Update All Feeds"); onClicked: controller.updateAll(); }
+ MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
+ }
+ }
+
+ Menu {
+ id: myArticlesMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("Mark All As Read"); onClicked: controller.markAllAsRead(feedid); }
+ MenuItem { text: qsTr("Update Feed"); onClicked: controller.updateFeed(feedid); }
MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
}
}
Page {
tools: commonTools
Categories {
- onCategoryClicked: pageStack.push(feedsPage, {catid: cat})
+ onCategoryClicked: {
+ window.catid = cat
+ pageStack.push(feedsPage)
+ }
}
}
}
Component {
id: feedsPage
+
Page {
- tools: commonTools
- property string catid
+ tools: feedsTools
+ anchors.fill: parent
+ property string catid: window.catid
Feeds {
id: feedsItem
- onFeedClicked: pageStack.push(articlesPage, {feedid: feedid})
+ onFeedClicked: {
+ window.feedid = feedid
+ pageStack.push(articlesPage)
+ }
+ }
+ ToolBarLayout {
+ id: feedsTools
+ visible: false
+ ToolIcon { iconId: "toolbar-back";
+ onClicked: {
+ myArticlesMenu.close();
+ pageStack.pop();
+ }
+ }
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (myFeedsMenu.status == DialogStatus.Closed) ? myFeedsMenu.open() : myFeedsMenu.close()
+ }
}
+ Connections {
+ target: window
+ onArticleClosed: feedsItem.reload()
+ }
}
}
id: articlesPage
Page {
tools: articleTools
- property string feedid
+ property string feedid: window.feedid
ArticleViewer {
id: flipper
}
- }
- ToolBarLayout {
- id: articleTools
- visible: false
- ToolIcon { iconId: "toolbar-back"; onClicked: {
- myMenu.close();
- if (flipper.articleShown) {
- flipper.articleShown = false;
- flipper.reload()
- } else {
- pageStack.pop();
+ ToolBarLayout {
+ id: articleTools
+ visible: false
+ ToolIcon { iconId: "toolbar-back";
+ onClicked: {
+ myArticlesMenu.close();
+ if (flipper.articleShown) {
+ flipper.articleShown = false;
+ flipper.reload()
+ } else {
+ window.articleClosed();
+ pageStack.pop();
+ }
}
}
- visible: pageStack.depth>1
- }
- ToolIcon {
- platformIconId: "toolbar-view-menu"
- anchors.right: (parent === undefined) ? undefined : parent.right
- onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
+
+ ToolIcon {
+ platformIconId: "toolbar-prev"
+ //anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: flipper.prev();
+ }
+
+ ToolIcon {
+ platformIconId: "toolbar-next"
+ //anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: flipper.next()
+ }
+
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
+ }
}
}
}