Kirigami2

styles/Material/InlineMessage.qml
1 /*
2  * SPDX-FileCopyrightText: 2018 Eike Hein <[email protected]>
3  * SPDX-FileCopyrightText: 2018 Marco Martin <[email protected]>
4  * SPDX-FileCopyrightText: 2018 Kai Uwe Broulik <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.0-or-later
7  */
8 
9 import QtQuick 2.7
10 import QtGraphicalEffects 1.0
11 import org.kde.kirigami 2.5 as Kirigami
12 
13 import "../../private"
14 import "../../templates" as T
15 
65 T.InlineMessage {
66  id: root
67 
68  background: Rectangle {
69  id: bgBorderRect
70 
71  color: {
72  if (root.type == Kirigami.MessageType.Positive) {
73  return Kirigami.Theme.positiveTextColor;
74  } else if (root.type == Kirigami.MessageType.Warning) {
75  return Kirigami.Theme.neutralTextColor;
76  } else if (root.type == Kirigami.MessageType.Error) {
77  return Kirigami.Theme.negativeTextColor;
78  }
79 
80  return Kirigami.Theme.activeTextColor;
81  }
82 
83  radius: Kirigami.Units.smallSpacing / 2
84 
85  Rectangle {
86  id: bgFillRect
87 
88  anchors.fill: parent
89  anchors.margins: Kirigami.Units.devicePixelRatio
90 
91  color: Kirigami.Theme.backgroundColor
92 
93  radius: bgBorderRect.radius * 0.60
94  }
95 
96  Rectangle {
97  anchors.fill: bgFillRect
98 
99  color: bgBorderRect.color
100 
101  opacity: 0.20
102 
103  radius: bgFillRect.radius
104  }
105 
106  layer.enabled: true
107  layer.effect: DropShadow {
108  horizontalOffset: 0
109  verticalOffset: 1
110  radius: 12
111  samples: 32
112  color: Qt.rgba(0, 0, 0, 0.5)
113  }
114  }
115 }
Definition: icon.h:19
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:36:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.