mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
Make Filemessage background size by content
This commit is contained in:
parent
5f7f564e57
commit
d2e495532d
1 changed files with 12 additions and 2 deletions
|
@ -2,8 +2,7 @@ import QtQuick 2.6
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts 1.2
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
radius: 10
|
color: "transparent"
|
||||||
color: colors.dark
|
|
||||||
height: row.height + 24
|
height: row.height + 24
|
||||||
width: parent ? parent.width : undefined
|
width: parent ? parent.width : undefined
|
||||||
|
|
||||||
|
@ -39,6 +38,7 @@ Rectangle {
|
||||||
id: col
|
id: col
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
id: filename
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: model.data.body
|
text: model.data.body
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
@ -46,6 +46,7 @@ Rectangle {
|
||||||
color: colors.text
|
color: colors.text
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
id: filesize
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: model.data.filesize
|
text: model.data.filesize
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
@ -54,4 +55,13 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: colors.dark
|
||||||
|
z: -1
|
||||||
|
radius: 10
|
||||||
|
height: row.height + 24
|
||||||
|
width: 44 + 24 + 24 + Math.max(Math.min(filesize.width, filesize.implicitWidth), Math.min(filename.width, filename.implicitWidth))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue