diff options
Diffstat (limited to 'kodereviewer/qml/PullRequestFilesDrawer.qml')
-rw-r--r-- | kodereviewer/qml/PullRequestFilesDrawer.qml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kodereviewer/qml/PullRequestFilesDrawer.qml b/kodereviewer/qml/PullRequestFilesDrawer.qml new file mode 100644 index 0000000..e54fc7b --- /dev/null +++ b/kodereviewer/qml/PullRequestFilesDrawer.qml @@ -0,0 +1,57 @@ +import QtQuick +import QtQuick.Controls as QQC2 +import QtQuick.Layouts + +import org.kde.kirigami as Kirigami + +import org.kde.kirigamiaddons.delegates as Delegates +import org.deprecated.kodereviewer 1.0 + +Kirigami.OverlayDrawer { + id: root + + required property FileModel fileModel + + width: actualWidth + + readonly property int minWidth: Kirigami.Units.gridUnit * 15 + readonly property int maxWidth: Kirigami.Units.gridUnit * 25 + readonly property int defaultWidth: Kirigami.Units.gridUnit * 20 + property int actualWidth: { + return Kirigami.Units.gridUnit * 20; + } + + onOpened: forceActiveFocus() + + edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge + + topPadding: 0 + bottomPadding: 0 + leftPadding: 0 + rightPadding: 0 + + Kirigami.Theme.colorSet: Kirigami.Theme.View + + contentItem: Loader { + id: loader + active: root.drawerOpen + + sourceComponent: QQC2.ScrollView { + ListView { + id: listView + model: root.fileModel + delegate: Delegates.RoundedItemDelegate { + required property string filename + required property string patch + highlighted: ListView.isCurrentItem + text: filename + + onClicked: { + textArea.text = patch + textArea.file = filename + } + } + } + } + } +} |