Warning, /frameworks/kirigami/src/styles/Material/InlineMessage.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2018 Eike Hein <hein@kde.org>
0003  *  SPDX-FileCopyrightText: 2018 Marco Martin <mart@kde.org>
0004  *  SPDX-FileCopyrightText: 2018 Kai Uwe Broulik <kde@privat.broulik.de>
0005  *
0006  *  SPDX-License-Identifier: LGPL-2.0-or-later
0007  */
0008 
0009 import QtQuick
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.kirigami.templates as KT
0012 
0013 KT.InlineMessage {
0014     id: root
0015 
0016     // a rectangle padded with anchors.margins is used to simulate a border
0017     padding: bgFillRect.anchors.margins + Kirigami.Units.smallSpacing
0018 
0019     background: Kirigami.ShadowedRectangle {
0020         id: bgBorderRect
0021 
0022         color: switch (root.type) {
0023             case Kirigami.MessageType.Positive: return Kirigami.Theme.positiveTextColor;
0024             case Kirigami.MessageType.Warning: return Kirigami.Theme.neutralTextColor;
0025             case Kirigami.MessageType.Error: return Kirigami.Theme.negativeTextColor;
0026             default: return Kirigami.Theme.activeTextColor;
0027         }
0028 
0029         radius: Kirigami.Units.smallSpacing / 2
0030         shadow.size: 12
0031         shadow.xOffset: 0
0032         shadow.yOffset: 1
0033         shadow.color: Qt.rgba(0, 0, 0, 0.5)
0034 
0035         Rectangle {
0036             id: bgFillRect
0037 
0038             anchors.fill: parent
0039             anchors.margins: 1
0040 
0041             color: Kirigami.Theme.backgroundColor
0042 
0043             radius: bgBorderRect.radius * 0.60
0044         }
0045 
0046         Rectangle {
0047             anchors.fill: bgFillRect
0048 
0049             color: bgBorderRect.color
0050 
0051             opacity: 0.20
0052 
0053             radius: bgFillRect.radius
0054         }
0055     }
0056 }