linphone-desktop/linphone-app/ui/modules/Linphone/Chat/ChatFilePreview.qml
Julien Wadel 8c9e610107 - Fix crash and leaks on restart/quit.
- Reload conference list when current account change.
- Fix popup design (margins).
- Factorization of message banner (eg. copy text message)
- Factorization of NewConference dialog.
- Fix design on file preview in chat.
- Add participant shortcut in video conference.
- Remove old Linphone-Utils file/scripts.
- Fix avatar image in history view when clicking on username.
2022-05-13 17:38:43 +02: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()
}
}
}