2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
2021-03-07 07:57:56 +03:00
|
|
|
//
|
2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-02-14 03:28:28 +03:00
|
|
|
import QtQuick 2.12
|
2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick.Layouts 1.2
|
2020-06-24 17:24:22 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
2020-04-09 01:10:08 +03:00
|
|
|
Item {
|
2021-07-12 01:24:33 +03:00
|
|
|
required property string eventId
|
|
|
|
required property string filename
|
|
|
|
required property string filesize
|
|
|
|
|
2020-10-08 22:11:21 +03:00
|
|
|
height: row.height + 24
|
|
|
|
width: parent ? parent.width : undefined
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: row
|
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
width: parent.width - 24
|
|
|
|
spacing: 15
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: button
|
|
|
|
|
2021-05-13 09:23:56 +03:00
|
|
|
color: Nheko.colors.light
|
2020-10-08 22:11:21 +03:00
|
|
|
radius: 22
|
|
|
|
height: 44
|
|
|
|
width: 44
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: img
|
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: "qrc:/icons/icons/ui/arrow-pointing-down.png"
|
|
|
|
fillMode: Image.Pad
|
|
|
|
}
|
|
|
|
|
2021-02-14 03:28:28 +03:00
|
|
|
TapHandler {
|
2021-07-12 01:24:33 +03:00
|
|
|
onSingleTapped: room.saveMedia(eventId)
|
2021-04-11 23:24:39 +03:00
|
|
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
2021-02-14 03:28:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
CursorShape {
|
|
|
|
anchors.fill: parent
|
2020-10-08 22:11:21 +03:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: col
|
|
|
|
|
|
|
|
Text {
|
2021-07-12 01:24:33 +03:00
|
|
|
id: filename_
|
2020-10-08 22:11:21 +03:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2021-07-12 01:24:33 +03:00
|
|
|
text: filename
|
2020-10-08 22:11:21 +03:00
|
|
|
textFormat: Text.PlainText
|
|
|
|
elide: Text.ElideRight
|
2021-05-13 09:23:56 +03:00
|
|
|
color: Nheko.colors.text
|
2020-10-08 22:11:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
2021-07-12 01:24:33 +03:00
|
|
|
id: filesize_
|
2020-10-08 22:11:21 +03:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2021-07-12 01:24:33 +03:00
|
|
|
text: filesize
|
2020-10-08 22:11:21 +03:00
|
|
|
textFormat: Text.PlainText
|
|
|
|
elide: Text.ElideRight
|
2021-05-13 09:23:56 +03:00
|
|
|
color: Nheko.colors.text
|
2020-10-08 22:11:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
2021-05-13 09:23:56 +03:00
|
|
|
color: Nheko.colors.alternateBase
|
2020-10-08 22:11:21 +03:00
|
|
|
z: -1
|
|
|
|
radius: 10
|
|
|
|
height: row.height + 24
|
2021-07-12 01:24:33 +03:00
|
|
|
width: 44 + 24 + 24 + Math.max(Math.min(filesize_.width, filesize_.implicitWidth), Math.min(filename_.width, filename_.implicitWidth))
|
2020-10-08 22:11:21 +03:00
|
|
|
}
|
2020-04-09 00:38:58 +03:00
|
|
|
|
2019-10-04 02:10:46 +03:00
|
|
|
}
|