Skip to content

Commit

Permalink
Merge pull request sailfishos#94 from jpetrell/jb14363
Browse files Browse the repository at this point in the history
[sailfish-office] Calculate number of visible cover list items dynami…
  • Loading branch information
Joona Petrell authored Oct 5, 2016
2 parents d6b003a + 3c9b4b1 commit eaf92df
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions qml/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,29 @@ CoverBackground {
ListView {
id: fileListView

property real itemHeight: Theme.iconSizeSmall + Theme.paddingSmall*2

property int itemHeight: height/maxItemCount
property int maxItemCount: Math.round(height/(dummy.height + Theme.paddingSmall))
clip: true
interactive: false
model: window.fileListModel
visible: window.documentItem === null
y: Theme.paddingLarge
width: parent.width
height: 7*itemHeight
anchors {
fill: parent
topMargin: Theme.paddingLarge
bottomMargin: Theme.paddingLarge
}

delegate: CoverFileItem {
width: fileListView.width
height: fileListView.itemHeight
text: model.fileName
iconSource: window.mimeToIcon(model.fileMimeType)
}
Label {
id: dummy
visible: false
text: "Dummy"
}
}

Item {
Expand Down

0 comments on commit eaf92df

Please sign in to comment.