matrixion/resources/qml/RawMessageDialog.qml

52 lines
1.1 KiB
QML
Raw Normal View History

2021-07-31 05:13:58 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.15
import QtQuick.Controls 2.15
import im.nheko 1.0
ApplicationWindow {
id: rawMessageRoot
property alias rawMessage: rawMessageView.text
x: MainWindow.x + (MainWindow.width / 2) - (width / 2)
y: MainWindow.y + (MainWindow.height / 2) - (height / 2)
height: 420
width: 420
palette: Nheko.colors
color: Nheko.colors.window
flags: Qt.Tool | Qt.WindowStaysOnTopHint
Shortcut {
sequence: StandardKey.Cancel
onActivated: rawMessageRoot.close()
}
ScrollView {
2021-07-31 20:55:56 +03:00
anchors.margins: Nheko.paddingMedium
2021-07-31 05:13:58 +03:00
anchors.fill: parent
palette: Nheko.colors
padding: Nheko.paddingMedium
TextArea {
id: rawMessageView
font: Nheko.monospaceFont()
2021-07-31 20:55:56 +03:00
color: Nheko.colors.text
2021-07-31 05:13:58 +03:00
readOnly: true
2021-07-31 20:55:56 +03:00
background: Rectangle {
color: Nheko.colors.base
}
2021-07-31 05:13:58 +03:00
}
}
footer: DialogButtonBox {
standardButtons: DialogButtonBox.Ok
onAccepted: rawMessageRoot.close()
}
}