diff options
Diffstat (limited to 'qml')
-rw-r--r-- | qml/ForumPage.qml | 6 | ||||
-rw-r--r-- | qml/NewPostSheet.qml | 38 | ||||
-rw-r--r-- | qml/TopicPage.qml | 18 |
3 files changed, 62 insertions, 0 deletions
diff --git a/qml/ForumPage.qml b/qml/ForumPage.qml index ee04e43..4f2b64f 100644 --- a/qml/ForumPage.qml +++ b/qml/ForumPage.qml @@ -18,6 +18,9 @@ Page { onClicked: pageStack.pop() } ToolIcon { + platformIconId: "toolbar-add" + } + ToolIcon { platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh" onClicked: { if (board.busy) { @@ -27,6 +30,9 @@ Page { } } } + ToolIcon { + platformIconId: "toolbar-view-menu" + } } ListView { diff --git a/qml/NewPostSheet.qml b/qml/NewPostSheet.qml new file mode 100644 index 0000000..96de9bc --- /dev/null +++ b/qml/NewPostSheet.qml @@ -0,0 +1,38 @@ +import QtQuick 1.1 +import com.nokia.meego 1.1 +import com.nokia.extras 1.1 +import com.javispedro.tapasboard 1.0 + +Sheet { + id: newPostSheet + + property Board board; + property int topicId; + + anchors.leftMargin: UiConstants.DefaultMargin + anchors.rightMargin: UiConstants.DefaultMargin + + acceptButtonText: qsTr("Submit") + rejectButtonText: qsTr("Cancel") + + content: TextArea { + id: postText + anchors { + fill: parent + } + + platformStyle: TextAreaStyle { + background: "image://theme/meegotouch-sheet-inputfield-background" + backgroundSelected: background + backgroundDisabled: "" + } + + placeholderText: qsTr("Write your reply here") + focus: true + wrapMode: TextEdit.Wrap + } + + onAccepted: { + board.replyToTopic(topicId, postText.text) + } +} diff --git a/qml/TopicPage.qml b/qml/TopicPage.qml index ebaa2c6..32a86ec 100644 --- a/qml/TopicPage.qml +++ b/qml/TopicPage.qml @@ -18,6 +18,19 @@ Page { onClicked: pageStack.pop() } ToolIcon { + platformIconId: "toolbar-add" + onClicked: { + var component = Qt.createComponent("NewPostSheet.qml"); + if (component.status === Component.Ready) { + var sheet = component.createObject(topicPage, { + "board": board, + "topicId": topicId + }); + sheet.open(); + } + } + } + ToolIcon { platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh" onClicked: { if (board.busy) { @@ -27,6 +40,9 @@ Page { } } } + ToolIcon { + platformIconId: "toolbar-view-menu" + } } ListView { @@ -49,6 +65,8 @@ Page { text: section } + cacheBuffer: 200 + delegate: Item { id: postItem |