summaryrefslogtreecommitdiff
path: root/qml/tapasboard/TopicPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/tapasboard/TopicPage.qml')
-rw-r--r--qml/tapasboard/TopicPage.qml63
1 files changed, 63 insertions, 0 deletions
diff --git a/qml/tapasboard/TopicPage.qml b/qml/tapasboard/TopicPage.qml
new file mode 100644
index 0000000..d39d36e
--- /dev/null
+++ b/qml/tapasboard/TopicPage.qml
@@ -0,0 +1,63 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
+import com.javispedro.tapasboard 1.0
+
+Page {
+ id: topicPage
+
+ anchors.leftMargin: UiConstants.DefaultMargin
+ anchors.rightMargin: UiConstants.DefaultMargin
+
+ property string boardUrl;
+ property int topicId;
+
+ tools: ToolBarLayout {
+ ToolIcon {
+ id: backToolIcon
+ platformIconId: "toolbar-back"
+ anchors.left: parent.left
+ onClicked: pageStack.pop()
+ }
+ }
+
+ ListView {
+ id: postsView
+ anchors.fill: parent
+ model: TopicModel {
+ boardUrl: topicPage.boardUrl
+ topicId: topicPage.topicId
+ }
+ delegate: Item {
+ id: postItem
+
+ height: Math.max(postItemColumn.height + UiConstants.ButtonSpacing * 2, UiConstants.ListItemHeightDefault)
+ width: parent.width
+
+ Column {
+ id: postItemColumn
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+
+ Text {
+ text: model.title
+ width: parent.width
+ font: UiConstants.TitleFont
+ visible: text != ""
+ }
+
+ Text {
+ text: model.content
+ width: parent.width
+ font: UiConstants.SubtitleFont
+ wrapMode: Text.Wrap
+ }
+ }
+ }
+ }
+
+ ScrollDecorator {
+ flickableItem: postsView
+ }
+}