linphone-desktop/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml
Julien Wadel eba233655e Bugfixes : MacOs crash, Video request not working, fonts
* Activate mipmap on MacOs to avoid Qt crashes
* Use 5.14.2 for Windows
* Request Qt 5.12 as a minimal version and cmake 3.9 (in order to embed big resources)
* Remove build on Debian8 as it has Qt 5.10
* Add default fonts for supported languages
* Use a build parameter to set `dpiawareness` (Windows)
* Add OTF support, in addition of TTF
* Explicit the answer to video request : Fix on not showing video when accepting a second request
* Use UTF8 when chatting and notifications to show all languages/symbols
* Fix SIP display on call view
* Fix a typo on a variable in call view (might lead to get transparent view)
2020-06-19 09:25:51 +02:00

79 lines
2.4 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone.Styles 1.0
import Utils 1.0
// =============================================================================
Notification {
id: notification
icon: 'file_sign'
overrodeHeight: NotificationReceivedFileMessageStyle.overrodeHeight
// ---------------------------------------------------------------------------
readonly property string fileUri: notificationData && notificationData.fileUri || ''
readonly property string imageUri: notificationData && notificationData.imageUri || ''
// ---------------------------------------------------------------------------
Loader {
active: Boolean(notification.fileUri)
anchors {
fill: parent
leftMargin: NotificationReceivedFileMessageStyle.leftMargin
rightMargin: NotificationReceivedFileMessageStyle.rightMargin
}
sourceComponent: RowLayout {
anchors.fill: parent
spacing: NotificationReceivedFileMessageStyle.spacing
Text {
Layout.fillWidth: true
color: NotificationReceivedFileMessageStyle.fileName.color
elide: Text.ElideRight
font.pointSize: NotificationReceivedFileMessageStyle.fileName.pointSize
text: Utils.basename(notification.fileUri)
visible:!image.visible
}
Image{
id:image
mipmap: Qt.platform.os === 'osx'
Layout.fillHeight: true
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit
source: (imageUri ?"image://external/"+notification.imageUri : '')
visible: image.status == Image.Ready
}
Text {
Layout.preferredWidth: NotificationReceivedFileMessageStyle.fileSize.width
color: NotificationReceivedFileMessageStyle.fileSize.color
elide: Text.ElideRight
font.pointSize: NotificationReceivedFileMessageStyle.fileSize.pointSize
horizontalAlignment: Text.AlignRight
text: Utils.formatSize(notification.notificationData.fileSize)
}
}
MouseArea {
anchors.fill: parent
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
onClicked: notification._close(function () {
var uri = Utils.getUriFromSystemPath(notification.fileUri)
if (!Qt.openUrlExternally(uri)) {
Qt.openUrlExternally(Utils.dirname(uri))
}
})
}
}
}