Skip to content

Commit

Permalink
Fix layout for FileProviderFileDelegate
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 31, 2023
1 parent 700261f commit 2178447
Showing 1 changed file with 30 additions and 49 deletions.
79 changes: 30 additions & 49 deletions src/gui/macOS/ui/FileProviderFileDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,14 @@ Item {

required property size documentSize

GridLayout {
RowLayout {
id: internalLayout

anchors.fill: parent
rows: 3
columns: 4

Image {
id: fileIconImage

Layout.fillHeight: true
Layout.row: 0
Layout.rowSpan: internalLayout.rows
Layout.column: 0

verticalAlignment: Image.AlignVCenter
horizontalAlignment: Image.AlignHCenter
source: "image://tray-image-provider/:/fileicon/" + root.userVisiblePath
Expand All @@ -59,60 +52,48 @@ Item {
fillMode: Image.PreserveAspectFit
}

EnforcedPlainTextLabel {
id: fileNameLabel

Column {
Layout.fillWidth: true
Layout.row: 0
Layout.column: 1
Layout.columnSpan: 2

text: root.fileName
EnforcedPlainTextLabel {
id: fileNameLabel
width: parent.width
text: root.fileName
}

EnforcedPlainTextLabel {
id: pathLabel
width: parent.width
text: root.userVisiblePath
elide: Text.ElideLeft
}

Row {
width: parent.width

EnforcedPlainTextLabel {
id: fileSizeLabel
text: root.documentSize
}

EnforcedPlainTextLabel {
id: fileTypeLabel
text: root.fileType
color: Style.ncSecondaryTextColor
}
}
}

CustomButton {
id: deleteButton

Layout.preferredWidth: width
Layout.minimumWidth: implicitWidth
Layout.fillHeight: true
Layout.row: 0
Layout.rowSpan: internalLayout.rows
Layout.column: 2
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter

text: qsTr("Delete")
bgColor: Style.errorBoxBackgroundColor
onClicked: root.evictItem(root.identifier, root.domainIdentifier)
}

EnforcedPlainTextLabel {
id: pathLabel

Layout.fillWidth: true
Layout.row: 1
Layout.column: 1
Layout.columnSpan: 2

text: root.userVisiblePath
}

EnforcedPlainTextLabel {
id: fileSizeLabel

Layout.row: 2
Layout.column: 1

text: root.documentSize
}

EnforcedPlainTextLabel {
id: fileTypeLabel

Layout.row: 2
Layout.column: 2

text: root.fileType
color: Style.ncSecondaryTextColor
}
}
}

0 comments on commit 2178447

Please sign in to comment.