From: Claudio Cambra Date: Tue, 11 Apr 2023 17:30:35 +0000 (+0800) Subject: Display filetags in file details window X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~49^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cb8cab6f41d0cb633a5821e871faaf6442ce9258;p=nextcloud-desktop.git Display filetags in file details window Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/FileDetailsPage.qml b/src/gui/filedetails/FileDetailsPage.qml index ead5cd075..1982beffb 100644 --- a/src/gui/filedetails/FileDetailsPage.qml +++ b/src/gui/filedetails/FileDetailsPage.qml @@ -81,7 +81,19 @@ Page { Layout.topMargin: root.topPadding columns: root.showCloseButton ? 3 : 2 - rows: showFileLockedString ? 3 : 2 + rows: { + let rows = 2; + + if (showFileLockedString) { + rows++; + } + + if (root.fileDetails.fileTagModel.totalTags > 0) { + rows++; + } + + return rows; + } rowSpacing: Style.standardSpacing / 2 columnSpacing: Style.standardSpacing @@ -154,6 +166,36 @@ Page { wrapMode: Text.Wrap visible: headerGridLayout.showFileLockedString } + + RowLayout { + id: tagRow + + Layout.fillWidth: true + Layout.rightMargin: headerGridLayout.textRightMargin + + Repeater { + id: tagRepeater + + readonly property var fileTagModel: root.fileDetails.fileTagModel + + model: fileTagModel + delegate: FileTag { + text: model.display + } + + Component.onCompleted: fileTagModel.maxTags = 3 + } + + FileTag { + id: overflowTag + + readonly property int totalFileTags: tagRepeater.fileTagModel.totalTags + readonly property int maxFileTags: tagRepeater.fileTagModel.maxTags + + visible: totalFileTags > maxFileTags + text: "+" + String(totalFileTags - maxFileTags) + } + } } TabBar {