From e2bd9e69e1afee57264741f7abfc1480c123fcb8 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 12 Apr 2023 12:11:33 +0800 Subject: [PATCH] Fix layout of tags with differing sizes and oversized tags Signed-off-by: Claudio Cambra --- src/gui/filedetails/FileDetailsPage.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/filedetails/FileDetailsPage.qml b/src/gui/filedetails/FileDetailsPage.qml index 1982beffb..ff43acb04 100644 --- a/src/gui/filedetails/FileDetailsPage.qml +++ b/src/gui/filedetails/FileDetailsPage.qml @@ -167,7 +167,7 @@ Page { visible: headerGridLayout.showFileLockedString } - RowLayout { + Row { id: tagRow Layout.fillWidth: true @@ -177,9 +177,14 @@ Page { id: tagRepeater readonly property var fileTagModel: root.fileDetails.fileTagModel + readonly property int maxTags: 3 model: fileTagModel 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 } -- 2.30.2