You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nheko/resources/qml/MessageInputWarning.qml

45 lines
1.2 KiB

// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import im.nheko 1.0
Rectangle {
id: warningRoot
property color bubbleColor: Nheko.theme.error
2 years ago
required property string text
Layout.fillWidth: true
color: palette.window // required to hide the timeline behind this warning
2 years ago
height: implicitHeight
implicitHeight: visible ? warningDisplay.implicitHeight + 4 * Nheko.paddingSmall : 0
Rectangle {
id: warningRect
2 years ago
anchors.fill: parent
anchors.margins: visible ? Nheko.paddingSmall : 0
border.color: bubbleColor
border.width: 1
// TODO: Qt.alpha() would make more sense but it wasn't working...
color: Qt.rgba(bubbleColor.r, bubbleColor.g, bubbleColor.b, 0.3)
radius: 3
2 years ago
visible: warningRoot.visible
z: 3
Label {
id: warningDisplay
anchors.left: parent.left
anchors.margins: Nheko.paddingSmall
2 years ago
anchors.verticalCenter: parent.verticalCenter
text: warningRoot.text
textFormat: Text.PlainText
}
}
}