summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/ControlCenter/Widgets/ErrorPill.qml
blob: cece4671c1acc3253260136dba9902c999010792 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import QtQuick
import qs.Common
import qs.Widgets

StyledRect {
    id: root

    LayoutMirroring.enabled: I18n.isRtl
    LayoutMirroring.childrenInherit: true

    property string primaryMessage: ""
    property string secondaryMessage: ""

    radius: Theme.cornerRadius
    color: Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.1)
    border.color: Theme.warning
    border.width: 1

    Row {
        anchors.fill: parent
        anchors.margins: Theme.spacingM
        spacing: Theme.spacingXS

        DankIcon {
            name: "warning"
            size: 16
            color: Theme.warning
            anchors.top: parent.top
            anchors.topMargin: 2
        }

        Column {
            width: parent.width - 16 - parent.spacing
            spacing: Theme.spacingXS

            StyledText {
                width: parent.width
                text: root.primaryMessage
                font.pixelSize: Theme.fontSizeSmall
                color: Theme.warning
                font.weight: Font.Medium
                wrapMode: Text.WordWrap
                horizontalAlignment: Text.AlignLeft
            }

            StyledText {
                width: parent.width
                text: root.secondaryMessage
                font.pixelSize: Theme.fontSizeSmall
                color: Theme.warning
                visible: text.length > 0
                horizontalAlignment: Text.AlignLeft
            }
        }
    }
}