diff options
author | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-03 10:48:42 -0300 |
---|---|---|
committer | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-03 10:48:42 -0300 |
commit | 440fd1dd8c194e4e02fc47725296812fba31df5d (patch) | |
tree | a70a6c2da257b01359f3bf9f65b0a3f08e255e9d /kodereviewer/qml/ProjectListPage.qml | |
parent | 1ab1edca0520ccb33196928f4a48cd521ef41d7c (diff) | |
download | kodereviewer-440fd1dd8c194e4e02fc47725296812fba31df5d.tar.gz |
Better layout
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 } } |