summary refs log tree commit diff
path: root/resources/qml/NotificationWarning.qml
blob: 2d0a09756d6b1db1ebc4a9cc9cd4f23f5cc38e79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
// SPDX-FileCopyrightText: 2023 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

Item {
    implicitHeight: warningRect.visible ? warningDisplay.implicitHeight : 0
    height: implicitHeight
    Layout.fillWidth: true

    Rectangle {
        id: warningRect

        visible: (room && room.permissions.canPingRoom() && room.input.containsAtRoom)
        color: Nheko.colors.base
        anchors.fill: parent
        z: 3

        Label {
            id: warningDisplay

            anchors.left: parent.left
            anchors.leftMargin: 10
            anchors.right: parent.right
            anchors.rightMargin: 10
            anchors.bottom: parent.bottom
            color: Nheko.theme.red
            text: qsTr("You are about to notify the whole room")
            textFormat: Text.PlainText
        }

    }

}