summaryrefslogtreecommitdiff
path: root/qml/ForumPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/ForumPage.qml')
-rw-r--r--qml/ForumPage.qml95
1 files changed, 95 insertions, 0 deletions
diff --git a/qml/ForumPage.qml b/qml/ForumPage.qml
new file mode 100644
index 0000000..ee04e43
--- /dev/null
+++ b/qml/ForumPage.qml
@@ -0,0 +1,95 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
+import com.javispedro.tapasboard 1.0
+
+Page {
+ id: forumPage
+
+ anchors.leftMargin: UiConstants.DefaultMargin
+ anchors.rightMargin: UiConstants.DefaultMargin
+
+ property Board board: null;
+ property int forumId;
+
+ tools: ToolBarLayout {
+ ToolIcon {
+ platformIconId: "toolbar-back"
+ onClicked: pageStack.pop()
+ }
+ ToolIcon {
+ platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh"
+ onClicked: {
+ if (board.busy) {
+ board.cancelAllActions();
+ } else {
+ forumModel.refresh();
+ }
+ }
+ }
+ }
+
+ ListView {
+ id: topicsView
+ anchors.fill: parent
+ model: ForumModel {
+ id: forumModel
+ board: forumPage.board
+ forumId: forumPage.forumId
+ }
+ delegate: EmptyListDelegate {
+ id: topicItem
+
+ height: Math.max(topicItemColumn.height + UiConstants.ButtonSpacing * 2, UiConstants.ListItemHeightDefault)
+
+ unread: model.unread
+
+ Column {
+ id: topicItemColumn
+ anchors.left: parent.left
+ anchors.right: topicRepliesCount.left
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: model.title
+ width: parent.width
+ font: UiConstants.TitleFont
+ wrapMode: Text.Wrap
+ }
+ }
+
+ CountBubble {
+ id: topicRepliesCount
+ anchors.right: topicItemImage.left
+ anchors.verticalCenter: parent.verticalCenter
+ value: model.numReplies
+ visible: value > 0
+ }
+
+ Image {
+ id: topicItemImage
+ source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ onClicked: {
+ pageStack.push(Qt.resolvedUrl("TopicPage.qml"), {
+ board: forumPage.board,
+ topicId: model.topicId
+ });
+ }
+ }
+ }
+
+ ScrollDecorator {
+ flickableItem: topicsView
+ }
+
+ BusyIndicator {
+ anchors.centerIn: parent
+ platformStyle: BusyIndicatorStyle { size: "large" }
+ visible: topicsView.count == 0 && board.busy
+ running: visible
+ }
+}