native: add scroll bar

fixes #27
This commit is contained in:
Johannes Jöns 2024-07-12 01:06:31 +02:00
parent c6074c26e0
commit f4cfabea81

View file

@ -99,6 +99,7 @@ Rectangle {
Rectangle { Rectangle {
height: 50 height: 50
id: rect1
width: parent.width width: parent.width
color: getColors().midlight color: getColors().midlight
@ -116,28 +117,36 @@ Rectangle {
} }
} }
ListView { ScrollView {
id: listView anchors {
top: rect1.bottom
}
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
model: filteredApiDataModel // Use the filtered model
delegate: Rectangle { ListView {
width: listView.width id: listView
height: 50 Layout.fillWidth: true
color: (index % 2 === 0) ? getColors().button : getColors().highlight // Alternating row colors Layout.fillHeight: true
model: filteredApiDataModel // Use the filtered model
RowLayout { delegate: Rectangle {
anchors.fill: parent width: listView.width
spacing: 10 height: 50
anchors.margins: 5 color: (index % 2 === 0) ? getColors().button : getColors().highlight // Alternating row colors
Text { text: model.name; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight } RowLayout {
Text { text: model.key; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight } anchors.fill: parent
Text { text: model.amount; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight } spacing: 10
Text { text: model.start; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight } anchors.margins: 5
Text { text: model.end; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight }
Text { text: model.group; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight } Text { text: model.name; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight }
Text { text: model.key; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight }
Text { text: model.amount; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight }
Text { text: model.start; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight }
Text { text: model.end; color: getColors().text; Layout.preferredWidth: 100; elide: Text.ElideRight }
Text { text: model.group; color: getColors().text; Layout.preferredWidth: 150; elide: Text.ElideRight }
}
} }
} }
} }