From bbe83e74b2c1335a0a726c2f993bb2d8c47ffedc Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 14 Oct 2024 09:54:47 -0300 Subject: Functioning context drawer --- kodereviewer/qml/PullRequestPage.qml | 74 +++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 31 deletions(-) (limited to 'kodereviewer/qml/PullRequestPage.qml') 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 { -- cgit v1.2.3-70-g09d2