Skip to content

Commit f24f301

Browse files
MazhoonR1tschY
authored andcommitted
Fix visibility of multiple sections in DeviceList.
The itemHeight on trustedDevices ColumnView is set as Theme.itemSizeMedium, and the whole height is calculated as (device count)×itemHeight. However, this does not include the height of the section headers, causing the second section not be shown. Add extra space to fit the section headers (and try to scale this based on the available device count). Tested with 3 devices in different sections, and everything worked quite ok. Reserving the actual space needed by headers would be even better, but I didn't yet find a way to this. Additionally, use "section" as the sortrole instead of "name" to avoid having multiple instances of same section headers. Sorting first by section and then by name would be even better, but would need some work on the C++ side of the models, it seems.
1 parent 32a789e commit f24f301

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/qml/pages/DeviceListPage.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Page {
209209
SortFilterModel {
210210
id: trustedDevicesModel
211211

212-
sortRole: "name"
212+
sortRole: "section"
213213
sourceModel: devicelistModel
214214
}
215215

@@ -224,7 +224,7 @@ Page {
224224
ColumnView {
225225
id: trustedDevices
226226
width: page.width
227-
itemHeight: Theme.itemSizeMedium
227+
itemHeight: Theme.itemSizeMedium + (3 * Theme.itemSizeSmall / trustedDevices.count)
228228

229229

230230
model: trustedDevicesModel

0 commit comments

Comments
 (0)