diff options
Diffstat (limited to 'kodereviewer/qml/ProjectListPage.qml')
-rw-r--r-- | kodereviewer/qml/ProjectListPage.qml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/kodereviewer/qml/ProjectListPage.qml b/kodereviewer/qml/ProjectListPage.qml index 7ffa8b9..2846db1 100644 --- a/kodereviewer/qml/ProjectListPage.qml +++ b/kodereviewer/qml/ProjectListPage.qml @@ -14,7 +14,7 @@ Kirigami.Page { required property NetworkManager connection required property Project project - signal pullRequestSelected(var pullRequest) + signal pullRequestSelected(int pullRequest) readonly property int currentWidth: _private.currentWidth + 1 @@ -67,18 +67,26 @@ Kirigami.Page { QQC2.ScrollView { ListView { id: view - model: pullRequestFilterModel + model: pullRequestModel clip: true delegate: Delegates.RoundedItemDelegate { required property int number required property string title + required property bool draft required property int index + highlighted: ListView.isCurrentItem text: `${number} - ${title}` - icon.name: "vcs-merge-request" - - onClicked: root.pullRequestSelected(pullRequestModel.get(index)) + icon { + name: "vcs-merge-request" + color: draft ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.positiveTextColor + } + + onClicked: { + view.currentIndex = index + root.pullRequestSelected(number) + } } } } @@ -108,7 +116,7 @@ Kirigami.Page { } if (mouse.x > _lastX) { // _private.currentWidth = _private.currentWidth + (_lastX + mouse.x); - _private.currentWidth = Math.min(_private.defaultWidth, _private.currentWidth + (mouse.x - _lastX)) + _private.currentWidth = Math.min(_private.maxWidth, _private.currentWidth + (mouse.x - _lastX)) } else if (mouse.x < _lastX) { const tmpWidth = _private.currentWidth - (_lastX - mouse.x); if (tmpWidth > _private.minWidth) @@ -127,6 +135,7 @@ Kirigami.Page { property int currentWidth: defaultWidth readonly property int defaultWidth: Kirigami.Units.gridUnit * 17 readonly property int minWidth: Kirigami.Units.gridUnit * 2 + readonly property int maxWidth: Kirigami.Units.gridUnit * 25 } } |