matrixion/resources/qml/dialogs/RawMessageDialog.qml

58 lines
1.3 KiB
QML
Raw Permalink Normal View History

2021-07-31 05:13:58 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
// SPDX-FileCopyrightText: 2023 Nheko Contributors
2021-07-31 05:13:58 +03:00
//
// 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
height: 420
width: 420
palette: Nheko.colors
color: Nheko.colors.window
2021-08-19 17:55:54 +03:00
flags: Qt.Tool | Qt.WindowStaysOnTopHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
2021-07-31 05:13:58 +03:00
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
selectByMouse: !Settings.mobileMode
textFormat: Text.PlainText
2021-07-31 20:55:56 +03:00
anchors.fill: parent
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()
}
2021-07-31 05:13:58 +03:00
}