summary refs log tree commit diff
path: root/resources/qml/delegates/FileMessage.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-08 23:38:58 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-10 08:48:30 +0200
commitd2e495532dd592131a9e3db4391dcdf8f4a73154 (patch)
treed42cad2095b80043ec246d0465c17a45c5c01117 /resources/qml/delegates/FileMessage.qml
parentMerge pull request #161 from Nheko-Reborn/palettes (diff)
downloadnheko-d2e495532dd592131a9e3db4391dcdf8f4a73154.tar.xz
Make Filemessage background size by content
Diffstat (limited to 'resources/qml/delegates/FileMessage.qml')
-rw-r--r--resources/qml/delegates/FileMessage.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml
index 9a5300bb..cb2ae920 100644
--- a/resources/qml/delegates/FileMessage.qml
+++ b/resources/qml/delegates/FileMessage.qml
@@ -2,8 +2,7 @@ import QtQuick 2.6
 import QtQuick.Layouts 1.2
 
 Rectangle {
-	radius: 10
-	color: colors.dark
+	color: "transparent"
 	height: row.height + 24
 	width: parent ? parent.width : undefined
 
@@ -39,6 +38,7 @@ Rectangle {
 			id: col
 
 			Text {
+				id: filename
 				Layout.fillWidth: true
 				text: model.data.body
 				textFormat: Text.PlainText
@@ -46,6 +46,7 @@ Rectangle {
 				color: colors.text
 			}
 			Text {
+				id: filesize
 				Layout.fillWidth: true
 				text: model.data.filesize
 				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))
+	}
+
 }