linphone-desktop/linphone-app/ui/modules/Linphone/Chat/ChatFilePreview.qml
Julien Wadel 879db5f496 - Send multiple files in one message, with preview.
- Message preview manage huge heights.
- Chat design rework.
- Sort timelines by unread chat rooms.
- Fix thumbnails that weren't deleted.
- Play audio record on playback device instead of ringer device.
- Fix binding loops on scrollable areas.
- Change timeline filter to a minimal version.
- Fix record button hovering.
- Fix camera button in fullscreen.
2022-03-08 15:17:13 +01:00

86 lines
No EOL
2.1 KiB
QML

import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
import Utils 1.0
import UtilsCpp 1.0
import Units 1.0
import 'Chat.js' as Logic
// =============================================================================
Item{
visible: mainListView.count > 0
Layout.preferredHeight: visible ? ChatFilePreviewStyle.height : 0
function addFile(path){
contents.addFile(path)
}
ScrollableListView{
id: mainListView
spacing: ChatFilePreviewStyle.filePreview.closeButton.iconSize
anchors.fill: parent
anchors.rightMargin: ChatStyle.rightButtonMargin + ChatStyle.rightButtonLMargin + ChatStyle.rightButtonSize
orientation: Qt.Horizontal
model: ContentProxyModel{
id: contents
}
header:Component{
Item{
width: ChatFilePreviewStyle.filePreview.closeButton.iconSize/2
height:mainListView.height
}
}
footer: Component{
Item{
width: ChatFilePreviewStyle.filePreview.closeButton.iconSize
height:mainListView.height
}
}
delegate:
FileView{
height:mainListView.height-ChatFilePreviewStyle.filePreview.heightMargins
width: height * ChatFilePreviewStyle.filePreview.format
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 7
//anchors.horizontalCenter: parent.horizontalCenter
thumbnail: modelData.thumbnail
name: modelData.name
animationScale: 1.1
onClickOnFile: {
modelData.openFile()
}
ActionButton{
anchors.bottom: parent.top
anchors.bottomMargin: -height/2
anchors.left: parent.right
anchors.leftMargin: -width/2
isCustom: true
backgroundRadius: width
colorSet: ChatFilePreviewStyle.filePreview.removeButton
z: parent.z+1
onClicked:{
contents.remove(modelData)
}
}
}
}
ActionButton{
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: ChatStyle.rightButtonMargin
isCustom: true
backgroundRadius: width
colorSet: ChatFilePreviewStyle.filePreview.closeButton
z: parent.z+1
onClicked:{
contents.clear()
}
}
}