summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/PullRequestPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/PullRequestPage.qml')
-rw-r--r--kodereviewer/qml/PullRequestPage.qml84
1 files changed, 84 insertions, 0 deletions
diff --git a/kodereviewer/qml/PullRequestPage.qml b/kodereviewer/qml/PullRequestPage.qml
new file mode 100644
index 0000000..19defdc
--- /dev/null
+++ b/kodereviewer/qml/PullRequestPage.qml
@@ -0,0 +1,84 @@
+pragma ComponentBehavior: Bound
+import QtQuick
+import QtCore
+import QtQuick.Controls as QQC2
+import QtQuick.Layouts
+
+import org.kde.kirigami as Kirigami
+import org.kde.kirigamiaddons.formcard as FormCard
+
+import org.deprecated.kodereviewer 1.0
+
+Kirigami.ScrollablePage {
+ id: root
+
+ property var pullRequest
+ property NetworkManager connection
+
+ Kirigami.Theme.colorSet: Kirigami.Theme.View
+ Kirigami.Theme.inherit: false
+
+
+ CommentModel {
+ id: commentModel
+ pullRequest: root.pullRequest
+
+ onPullRequestChanged: root.connection.getPullRequestComments(pullRequest.number)
+ }
+
+ ListView {
+ id: listView
+ model: commentModel
+
+ spacing: Kirigami.Units.largeSpacing * 2
+ topMargin: Kirigami.Units.largeSpacing * 2
+ rightMargin: Kirigami.Units.largeSpacing * 2
+ leftMargin: Kirigami.Units.largeSpacing * 2
+ bottomMargin: Kirigami.Units.largeSpacing * 2 // + commentToolbar.heigh
+
+ header: ColumnLayout {
+ id: headerLayout
+ visible: !!root.pullRequest
+ width: ListView.view ? ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin : 0
+
+ Kirigami.Heading {
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ leftPadding: Kirigami.Units.largeSpacing
+ rightPadding: Kirigami.Units.largeSpacing
+ level: 1
+ text: root.pullRequest ? root.pullRequest.title : ""
+ wrapMode: Text.WordWrap
+ }
+
+ Kirigami.ListSectionHeader {
+ Layout.fillWidth: true
+ text: "description"
+ }
+
+ QQC2.Label {
+ Layout.fillWidth: true
+ Layout.fillHeight: false
+ leftPadding: Kirigami.Units.largeSpacing
+ rightPadding: Kirigami.Units.largeSpacing
+ text: root.pullRequest ? root.pullRequest.body : ""
+ textFormat: Text.MarkdownText
+ wrapMode: Text.WordWrap
+ }
+
+ Kirigami.ListSectionHeader {
+ Layout.fillWidth: true
+ text: "Comments"
+ }
+ }
+
+ delegate: CommentDelegate {}
+
+ Kirigami.PlaceholderMessage {
+ visible: !root.pullRequest
+ anchors.centerIn: parent
+ icon.name: "org.deprecated.kodereviewer"
+ text: "Select a pull request"
+ }
+ }
+}