summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matias@deprecated.org>2024-10-09 16:01:29 -0300
committerMatias Linares <matias@deprecated.org>2024-10-09 16:01:29 -0300
commitbc2d786dfdf4d7a0b3f57ca7e66f0daa78c56a87 (patch)
tree4f74352eec1f7eaf73d7758172b07cd7ecc19d23
parent1c2c47945b7b811f065bba9d70359f1b725f43a8 (diff)
downloadkodereviewer-bc2d786dfdf4d7a0b3f57ca7e66f0daa78c56a87.tar.gz
Separate pull request description
-rw-r--r--kodereviewer/qml/PullRequestDescription.qml194
-rw-r--r--kodereviewer/qml/PullRequestPage.qml18
2 files changed, 110 insertions, 102 deletions
diff --git a/kodereviewer/qml/PullRequestDescription.qml b/kodereviewer/qml/PullRequestDescription.qml
index a40ecd4..de5a679 100644
--- a/kodereviewer/qml/PullRequestDescription.qml
+++ b/kodereviewer/qml/PullRequestDescription.qml
@@ -9,125 +9,129 @@ import org.kde.kirigamiaddons.formcard as FormCard
import org.deprecated.kodereviewer 1.0
-Kirigami.FormLayout {
+ScrollView {
id: root
- anchors.fill: parent
- implicitWidth: parent.width
property var pullRequest: undefined
+ anchors.fill: parent
- 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.FormLayout {
+ anchors.fill: parent
+ implicitWidth: parent.width
- Kirigami.Separator {
- Kirigami.FormData.isSection: true
- }
+ 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
+ }
- RowLayout {
- Layout.fillWidth: true
- ColumnLayout {
+ Kirigami.Separator {
+ Kirigami.FormData.isSection: true
+ }
+
+ RowLayout {
Layout.fillWidth: true
- RowLayout {
- QQC2.Label {
- text: "Author"
- elide: Text.ElideRight
+ ColumnLayout {
+ Layout.fillWidth: true
+ RowLayout {
+ QQC2.Label {
+ text: "Author"
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest ? root.pullRequest.username : ""
+ elide: Text.ElideLeft
+ }
}
- QQC2.Label {
- text: root.pullRequest ? root.pullRequest.username : ""
- elide: Text.ElideLeft
+ RowLayout {
+ QQC2.Label {
+ text: "State: "
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest ? root.pullRequest.state : ""
+ elide: Text.ElideLeft
+ }
}
- }
- RowLayout {
- QQC2.Label {
- text: "State: "
- elide: Text.ElideRight
+ RowLayout {
+ QQC2.Label {
+ text: "Draft?: "
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest ? root.pullRequest.draft ? i18n("Yes") : i18n("No") : ""
+ elide: Text.ElideLeft
+ }
}
- QQC2.Label {
- text: root.pullRequest ? root.pullRequest.state : ""
- elide: Text.ElideLeft
+
+ RowLayout {
+ QQC2.Label {
+ text: "Last commit: "
+ elide: Text.ElideRight
+ }
+ QQC2.Label {
+ text: root.pullRequest ? root.pullRequest.last_commit : ""
+ elide: Text.ElideLeft
+ }
}
}
- RowLayout {
- QQC2.Label {
- text: "Draft?: "
- elide: Text.ElideRight
- }
- QQC2.Label {
- text: root.pullRequest ? root.pullRequest.draft ? i18n("Yes") : i18n("No") : ""
- elide: Text.ElideLeft
+
+ ColumnLayout {
+ Layout.fillWidth: false
+ Layout.fillHeight: true
+ Repeater {
+ model: 0
+ delegate: QQC2.Label {
+ text: "#Faa"
+ }
}
}
+ }
- RowLayout {
- QQC2.Label {
- text: "Last commit: "
- elide: Text.ElideRight
- }
- QQC2.Label {
- text: root.pullRequest ? root.pullRequest.last_commit : ""
- elide: Text.ElideLeft
- }
+ Loader {
+ id: labelModelLoader
+ active: !!root.pullRequest
+ sourceComponent: LabelModel {
+ pullRequest: root.pullRequest
}
}
- ColumnLayout {
- Layout.fillWidth: false
- Layout.fillHeight: true
+ RowLayout {
Repeater {
- model: 0
- delegate: QQC2.Label {
- text: "#Faa"
+ model: labelModelLoader.item
+ delegate: Rectangle {
+ required property string name
+ required property string labelColor
+ required property string textColor
+ color: labelColor
+ width: thelabel.implicitWidth
+ height: thelabel.implicitHeight
+ radius: 5
+ QQC2.Label {
+ id: thelabel
+ padding: Kirigami.Units.smallSpacing
+ text: name
+ color: textColor
+ }
}
}
}
- }
- Loader {
- id: labelModelLoader
- active: !!root.pullRequest
- sourceComponent: LabelModel {
- pullRequest: root.pullRequest
+ Kirigami.Separator {
+ Kirigami.FormData.isSection: true
+ Kirigami.FormData.label: "Description"
}
- }
- RowLayout {
- Repeater {
- model: labelModelLoader.item
- delegate: Rectangle {
- required property string name
- required property string labelColor
- required property string textColor
- color: labelColor
- width: thelabel.implicitWidth
- height: thelabel.implicitHeight
- radius: 5
- QQC2.Label {
- id: thelabel
- padding: Kirigami.Units.smallSpacing
- text: name
- color: textColor
- }
- }
+ MarkdownLabel {
+ Layout.fillWidth: true
+ Layout.fillHeight: false
+ leftPadding: Kirigami.Units.largeSpacing
+ rightPadding: Kirigami.Units.largeSpacing
+ text: root.pullRequest ?
+ (root.pullRequest.body != "" ? root.pullRequest.body : "*No description provided.*") : ""
}
}
-
- Kirigami.Separator {
- Kirigami.FormData.isSection: true
- Kirigami.FormData.label: "Description"
- }
-
- MarkdownLabel {
- Layout.fillWidth: true
- Layout.fillHeight: false
- leftPadding: Kirigami.Units.largeSpacing
- rightPadding: Kirigami.Units.largeSpacing
- text: root.pullRequest ?
- (root.pullRequest.body != "" ? root.pullRequest.body : "*No description provided.*") : ""
- }
}
diff --git a/kodereviewer/qml/PullRequestPage.qml b/kodereviewer/qml/PullRequestPage.qml
index 4747203..58e044d 100644
--- a/kodereviewer/qml/PullRequestPage.qml
+++ b/kodereviewer/qml/PullRequestPage.qml
@@ -40,6 +40,7 @@ Kirigami.ScrollablePage {
clearForm()
}
}
+
Loader {
id: commentModelLoader
active: !!root.pullRequest
@@ -72,16 +73,19 @@ Kirigami.ScrollablePage {
PullRequestDescription {
visible: !!root.pullRequest && root.currentView == "info"
pullRequest: root.pullRequest
+ anchors.centerIn: parent
}
-
- ColumnLayout {
+/*
+ Kirigami.CardsListView {
visible: !!root.pullRequest && root.currentView == "comments"
- Repeater {
- model: commentModelLoader.item
- delegate: CommentDelegate {}
- }
+ anchors.fill: parent
+ // Layout.fillWidth: true
+ // Layout.fillHeight: true
+ model: commentModelLoader.item
+ delegate: CommentDelegate {}
+ footerPositioning: ListView.OverlayFooter
}
-
+*/
FilesView {
visible: !!root.pullRequest && root.currentView == "files"
fileModel: fileModelLoader.item