Reduce Qt warnings on FileDialog in chat while in call.

Clean a margin link on the reply preview message.
This commit is contained in:
Julien Wadel 2022-06-09 13:08:02 +02:00
parent 8a8a042e3e
commit a04337c31e
6 changed files with 23 additions and 14 deletions

View file

@ -73,15 +73,22 @@ Item {
visible: droppableTextArea.enabled
onClicked: fileDialog.open()
FileDialog {
id: fileDialog
folder: shortcuts.home
title: qsTr('fileChooserTitle')
onAccepted: _emitFiles(fileDialog.fileUrls)
onClicked: fileDialogLoader.active=true
Loader{// Qt display warnings on open this FileDialog. A loader is used to avoid printing warnings each time a chat is shown.
id: fileDialogLoader
active: false
sourceComponent: Component{
FileDialog {
id: fileDialog
folder: shortcuts.home
title: qsTr('fileChooserTitle')
onAccepted: {_emitFiles(fileDialog.fileUrls);fileDialogLoader.active = false}
onRejected: fileDialogLoader.active = false
Component.onCompleted: fileDialog.open()
}
}
}
tooltipText: droppableTextArea.dropEnabled
? qsTr('attachmentTooltip')

View file

@ -32,7 +32,6 @@ Avatar {
}
username: (mainItem.isPaused || !_username) ? '' : _username
onUsernameChanged: console.log(username)
Text {
anchors.fill: parent
color: CallStyle.container.pause.text.color

View file

@ -399,7 +399,8 @@ Rectangle {
Layout.leftMargin: ChatStyle.sendArea.backgroundBorder.width
maxHeight: container.height - textAreaBorders.height
replyChatRoomModel: proxyModel.chatRoomModel
replyRightMargin: textArea.textRightMargin
replyLeftMargin: textArea.textLeftMargin
}
// -------------------------------------------------------------------------
// Send area.

View file

@ -19,6 +19,8 @@ ColumnLayout{
property int fitHeight: (replyPreview.visible ? replyPreview.height + replySeparator.height: 0 )
+ (audioPreview.visible ? audioPreview.height + audioSeparator.height: 0)
+ (filesPreview.visible ? filesPreview.height + filesSeparator.height: 0)
property alias replyRightMargin: replyPreview.rightMargin
property alias replyLeftMargin: replyPreview.leftMargin
spacing: 0
Layout.preferredHeight: fitHeight
Layout.maximumHeight: fitHeight> maxHeight ? maxHeight : fitHeight // ?? just using maxHeight doesn't work.

View file

@ -19,8 +19,8 @@ Rectangle{
property ChatRoomModel chatRoomModel
property int maxHeight : parent.maxHeight
Layout.preferredHeight: visible ? Math.min(messageContentsList.height + replyPreviewHeaderArea.implicitHeight + 15, replyPreviewBlock.maxHeight) : 0
property int leftMargin: textArea.textLeftMargin
property int rightMargin: textArea.textRightMargin
property int leftMargin: 10
property int rightMargin: 10
color: ChatStyle.replyPreview.backgroundColor
radius: 10

View file

@ -174,7 +174,7 @@ DialogPlus {
Timer {
interval: 50
repeat: true
running: SettingsModel.captureGraphRunning || call
running: SettingsModel.captureGraphRunning || call || false
onTriggered: call ? parent.value = call.microVu : parent.value = SettingsModel.getMicVolume()
}