mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
QML Reindentation
This commit is contained in:
parent
070820225d
commit
156ac7ffc2
1 changed files with 94 additions and 94 deletions
|
|
@ -11,99 +11,99 @@ import Utils 1.0
|
|||
// =============================================================================
|
||||
|
||||
Item {
|
||||
implicitHeight: message.height
|
||||
//width: parent.width
|
||||
Layout.fillWidth: true
|
||||
|
||||
signal copyAllDone()
|
||||
signal copySelectionDone()
|
||||
signal replyClicked()
|
||||
signal forwardClicked()
|
||||
signal goToMessage(ChatMessageModel message)
|
||||
signal conferenceIcsCopied()
|
||||
|
||||
Message {
|
||||
id: message
|
||||
|
||||
onCopyAllDone: parent.copyAllDone()
|
||||
onCopySelectionDone: parent.copySelectionDone()
|
||||
onReplyClicked: parent.replyClicked()
|
||||
onForwardClicked: parent.forwardClicked()
|
||||
onGoToMessage: parent.goToMessage(message)
|
||||
onConferenceIcsCopied: parent.conferenceIcsCopied()
|
||||
implicitHeight: message.height
|
||||
//width: parent.width
|
||||
Layout.fillWidth: true
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: ChatStyle.entry.metaWidth
|
||||
right: parent.right
|
||||
}
|
||||
backgroundColor: ChatStyle.entry.message.outgoing.backgroundColor
|
||||
width: parent.width
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: ChatStyle.entry.message.extraContent.leftMargin
|
||||
spacing: ChatStyle.entry.message.extraContent.spacing
|
||||
|
||||
Component {
|
||||
id: iconComponent
|
||||
|
||||
Icon {
|
||||
id: iconId
|
||||
readonly property var isError: Utils.includes([
|
||||
LinphoneEnums.ChatMessageStateFileTransferError,
|
||||
LinphoneEnums.ChatMessageStateNotDelivered,
|
||||
], $chatEntry.state)
|
||||
readonly property bool isUploaded: $chatEntry.state == LinphoneEnums.ChatMessageStateDelivered
|
||||
readonly property bool isDelivered: $chatEntry.state == LinphoneEnums.ChatMessageStateDeliveredToUser
|
||||
readonly property bool isRead: $chatEntry.state == LinphoneEnums.ChatMessageStateDisplayed
|
||||
|
||||
icon: iconId.isError
|
||||
? 'chat_error'
|
||||
: (iconId.isRead ? 'chat_read' : (iconId.isDelivered ? 'chat_delivered' : '' ) )
|
||||
iconSize: ChatStyle.entry.message.outgoing.sendIconSize
|
||||
|
||||
MouseArea {
|
||||
id:retryAction
|
||||
anchors.fill: parent
|
||||
visible: iconId.isError || $chatEntry.state == LinphoneEnums.ChatMessageStateIdle
|
||||
onClicked: $chatEntry.resendMessage()
|
||||
}
|
||||
|
||||
TooltipArea {
|
||||
id:tooltip
|
||||
visible: text != ''
|
||||
text: iconId.isError
|
||||
? qsTr('messageError')
|
||||
: (iconId.isRead ? qsTr('messageRead') : (isDelivered ? qsTr('messageDelivered') : ''))
|
||||
hoveringCursor : retryAction.visible?Qt.PointingHandCursor:Qt.ArrowCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: indicator
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
|
||||
height: ChatStyle.entry.message.outgoing.busyIndicatorSize
|
||||
width: ChatStyle.entry.message.outgoing.busyIndicatorSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
height: ChatStyle.entry.lineHeight
|
||||
width: ChatStyle.entry.message.outgoing.areaSize
|
||||
|
||||
sourceComponent: $chatEntry.state == LinphoneEnums.ChatMessageStateInProgress || $chatEntry.state == LinphoneEnums.ChatMessageStateFileTransferInProgress
|
||||
? indicator
|
||||
: iconComponent
|
||||
}
|
||||
}
|
||||
}
|
||||
signal copyAllDone()
|
||||
signal copySelectionDone()
|
||||
signal replyClicked()
|
||||
signal forwardClicked()
|
||||
signal goToMessage(ChatMessageModel message)
|
||||
signal conferenceIcsCopied()
|
||||
|
||||
Message {
|
||||
id: message
|
||||
|
||||
onCopyAllDone: parent.copyAllDone()
|
||||
onCopySelectionDone: parent.copySelectionDone()
|
||||
onReplyClicked: parent.replyClicked()
|
||||
onForwardClicked: parent.forwardClicked()
|
||||
onGoToMessage: parent.goToMessage(message)
|
||||
onConferenceIcsCopied: parent.conferenceIcsCopied()
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: ChatStyle.entry.metaWidth
|
||||
right: parent.right
|
||||
}
|
||||
backgroundColor: ChatStyle.entry.message.outgoing.backgroundColor
|
||||
width: parent.width
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: ChatStyle.entry.message.extraContent.leftMargin
|
||||
spacing: ChatStyle.entry.message.extraContent.spacing
|
||||
|
||||
Component {
|
||||
id: iconComponent
|
||||
|
||||
Icon {
|
||||
id: iconId
|
||||
readonly property var isError: Utils.includes([
|
||||
LinphoneEnums.ChatMessageStateFileTransferError,
|
||||
LinphoneEnums.ChatMessageStateNotDelivered,
|
||||
], $chatEntry.state)
|
||||
readonly property bool isUploaded: $chatEntry.state == LinphoneEnums.ChatMessageStateDelivered
|
||||
readonly property bool isDelivered: $chatEntry.state == LinphoneEnums.ChatMessageStateDeliveredToUser
|
||||
readonly property bool isRead: $chatEntry.state == LinphoneEnums.ChatMessageStateDisplayed
|
||||
|
||||
icon: iconId.isError
|
||||
? 'chat_error'
|
||||
: (iconId.isRead ? 'chat_read' : (iconId.isDelivered ? 'chat_delivered' : '' ) )
|
||||
iconSize: ChatStyle.entry.message.outgoing.sendIconSize
|
||||
|
||||
MouseArea {
|
||||
id:retryAction
|
||||
anchors.fill: parent
|
||||
visible: iconId.isError || $chatEntry.state == LinphoneEnums.ChatMessageStateIdle
|
||||
onClicked: $chatEntry.resendMessage()
|
||||
}
|
||||
|
||||
TooltipArea {
|
||||
id:tooltip
|
||||
visible: text != ''
|
||||
text: iconId.isError
|
||||
? qsTr('messageError')
|
||||
: (iconId.isRead ? qsTr('messageRead') : (isDelivered ? qsTr('messageDelivered') : ''))
|
||||
hoveringCursor : retryAction.visible?Qt.PointingHandCursor:Qt.ArrowCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: indicator
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
|
||||
height: ChatStyle.entry.message.outgoing.busyIndicatorSize
|
||||
width: ChatStyle.entry.message.outgoing.busyIndicatorSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
height: ChatStyle.entry.lineHeight
|
||||
width: ChatStyle.entry.message.outgoing.areaSize
|
||||
|
||||
sourceComponent: $chatEntry.state == LinphoneEnums.ChatMessageStateInProgress || $chatEntry.state == LinphoneEnums.ChatMessageStateFileTransferInProgress
|
||||
? indicator
|
||||
: iconComponent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue