Fix layout of tags with differing sizes and oversized tags

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-04-12 12:11:33 +08:00
parent 65e7f6da9c
commit e2bd9e69e1

View file

@ -167,7 +167,7 @@ Page {
visible: headerGridLayout.showFileLockedString visible: headerGridLayout.showFileLockedString
} }
RowLayout { Row {
id: tagRow id: tagRow
Layout.fillWidth: true Layout.fillWidth: true
@ -177,9 +177,14 @@ Page {
id: tagRepeater id: tagRepeater
readonly property var fileTagModel: root.fileDetails.fileTagModel readonly property var fileTagModel: root.fileDetails.fileTagModel
readonly property int maxTags: 3
model: fileTagModel model: fileTagModel
delegate: FileTag { delegate: FileTag {
readonly property int availableLayoutSpace: tagRow.width - tagRow.spacing - overflowTag.width
readonly property int maxWidth: (availableLayoutSpace / tagRepeater.maxTags) - tagRow.spacing
width: Math.min(maxWidth, implicitWidth)
text: model.display text: model.display
} }