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.qml74
1 files changed, 43 insertions, 31 deletions
diff --git a/kodereviewer/qml/PullRequestPage.qml b/kodereviewer/qml/PullRequestPage.qml
index 860bfcb..cdcc1ec 100644
--- a/kodereviewer/qml/PullRequestPage.qml
+++ b/kodereviewer/qml/PullRequestPage.qml
@@ -34,7 +34,11 @@ Kirigami.ScrollablePage {
icon.name: "file-catalog-symbolic"
enabled: !!root.pullRequest
onTriggered: {
- contextDrawer.open()
+ if(contextDrawer.opened) {
+ contextDrawer.close()
+ } else {
+ contextDrawer.open()
+ }
}
}
]
@@ -72,21 +76,6 @@ Kirigami.ScrollablePage {
}
}
- Loader {
- id: treeFileModelLoader
- active: !!root.pullRequest
- sourceComponent: TreeFileModel {
- pullRequest: root.pullRequest
- }
- }
-
- KRContextDrawer {
- id: contextDrawer
- enabled: !!root.pullRequest
- modal: true
- model: treeFileModelLoader.item
- }
-
Kirigami.PlaceholderMessage {
visible: !root.pullRequest
anchors.centerIn: parent
@@ -94,25 +83,48 @@ Kirigami.ScrollablePage {
text: "Select a pull request"
}
- PullRequestDescription {
- visible: !!root.pullRequest && root.currentView == "info"
- pullRequest: root.pullRequest
+ ColumnLayout {
+ id: mainLayout
anchors.fill: parent
- }
+ PullRequestDescription {
+ visible: !!root.pullRequest && root.currentView == "info"
+ pullRequest: root.pullRequest
- Kirigami.CardsListView {
- visible: !!root.pullRequest && root.currentView == "comments"
- anchors.fill: parent
- // Layout.fillWidth: true
- // Layout.fillHeight: true
- model: commentModelLoader.item
- delegate: CommentDelegate {}
- footerPositioning: ListView.OverlayFooter
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ //anchors.fill: parent
+ }
+
+ Kirigami.CardsListView {
+ visible: !!root.pullRequest && root.currentView == "comments"
+ //anchors.fill: parent
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ model: commentModelLoader.item
+ delegate: CommentDelegate {}
+ footerPositioning: ListView.OverlayFooter
+ }
+
+ Editor {
+ visible: !!root.pullRequest && root.currentView == "files"
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+
+ id: editor
+ text: ""
+ file: ""
+ //fileModel: fileModelLoader.item
+ }
}
- FilesView {
- visible: !!root.pullRequest && root.currentView == "files"
- fileModel: fileModelLoader.item
+ Connections {
+ target: contextDrawer
+ function onFileSelected(filename, text) {
+ print("ASDF")
+ editor.filename = filename + '.diff'
+ editor.text = text
+ }
}
footer: Kirigami.NavigationTabBar {