Format qml

This commit is contained in:
Nicolas Werner 2023-06-02 01:45:24 +02:00
parent de8522a185
commit 5aee8d609a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
28 changed files with 2623 additions and 2954 deletions

View file

@ -12,91 +12,89 @@ Rectangle {
id: replyPopup
Layout.fillWidth: true
visible: room && (room.reply || room.edit || room.thread)
color: palette.window
// Height of child, plus margins, plus border
implicitHeight: (room && room.reply ? replyPreview.height : Math.max(closeEditButton.height, closeThreadButton.height)) + Nheko.paddingSmall
color: palette.window
visible: room && (room.reply || room.edit || room.thread)
z: 3
Reply {
id: replyPreview
property var modelData: room ? room.getDump(room.reply, room.id) : {
}
property var modelData: room ? room.getDump(room.reply, room.id) : {}
visible: room && room.reply
anchors.left: parent.left
anchors.leftMargin: replyPopup.width < 450? Nheko.paddingSmall : (CallManager.callsSupported? 2*(22+16) : 1*(22+16))
anchors.leftMargin: replyPopup.width < 450 ? Nheko.paddingSmall : (CallManager.callsSupported ? 2 * (22 + 16) : 1 * (22 + 16))
anchors.right: parent.right
anchors.rightMargin: replyPopup.width < 450? 2*(22+16) : 3*(22+16)
anchors.rightMargin: replyPopup.width < 450 ? 2 * (22 + 16) : 3 * (22 + 16)
anchors.top: parent.top
anchors.topMargin: Nheko.paddingSmall
userColor: TimelineManager.userColor(modelData.userId, palette.window)
blurhash: modelData.blurhash ?? ""
body: modelData.body ?? ""
formattedBody: modelData.formattedBody ?? ""
encryptionError: modelData.encryptionError ?? 0
eventId: modelData.eventId ?? ""
filename: modelData.filename ?? ""
filesize: modelData.filesize ?? ""
formattedBody: modelData.formattedBody ?? ""
isOnlyEmoji: modelData.isOnlyEmoji ?? false
originalWidth: modelData.originalWidth ?? 0
proportionalHeight: modelData.proportionalHeight ?? 1
type: modelData.type ?? MtxEvent.UnknownMessage
typeString: modelData.typeString ?? ""
url: modelData.url ?? ""
originalWidth: modelData.originalWidth ?? 0
isOnlyEmoji: modelData.isOnlyEmoji ?? false
userColor: TimelineManager.userColor(modelData.userId, palette.window)
userId: modelData.userId ?? ""
userName: modelData.userName ?? ""
encryptionError: modelData.encryptionError ?? 0
visible: room && room.reply
width: parent.width
}
ImageButton {
id: closeReplyButton
visible: room && room.reply
ToolTip.text: qsTr("Close")
ToolTip.visible: closeReplyButton.hovered
anchors.margins: Nheko.paddingSmall
anchors.right: replyPreview.right
anchors.top: replyPreview.top
anchors.margins: Nheko.paddingSmall
hoverEnabled: true
width: 16
height: 16
hoverEnabled: true
image: ":/icons/icons/ui/dismiss.svg"
ToolTip.visible: closeReplyButton.hovered
ToolTip.text: qsTr("Close")
visible: room && room.reply
width: 16
onClicked: room.reply = undefined
}
ImageButton {
id: closeEditButton
visible: room && room.edit
anchors.right: closeThreadButton.left
ToolTip.text: qsTr("Cancel Edit")
ToolTip.visible: closeEditButton.hovered
anchors.margins: 8
anchors.right: closeThreadButton.left
anchors.top: parent.top
height: 22
hoverEnabled: true
image: ":/icons/icons/ui/dismiss_edit.svg"
visible: room && room.edit
width: 22
height: 22
ToolTip.visible: closeEditButton.hovered
ToolTip.text: qsTr("Cancel Edit")
onClicked: room.edit = undefined
}
ImageButton {
id: closeThreadButton
visible: room && room.thread
anchors.right: parent.right
anchors.margins: 8
anchors.top: parent.top
hoverEnabled: true
buttonTextColor: room ? TimelineManager.userColor(room.thread, palette.base) : palette.buttonText
image: ":/icons/icons/ui/dismiss_thread.svg"
width: 22
height: 22
ToolTip.visible: closeThreadButton.hovered
ToolTip.text: qsTr("Cancel Thread")
ToolTip.visible: closeThreadButton.hovered
anchors.margins: 8
anchors.right: parent.right
anchors.top: parent.top
buttonTextColor: room ? TimelineManager.userColor(room.thread, palette.base) : palette.buttonText
height: 22
hoverEnabled: true
image: ":/icons/icons/ui/dismiss_thread.svg"
visible: room && room.thread
width: 22
onClicked: room.thread = undefined
}
}