-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathFixedErrorBadge.qml
45 lines (43 loc) · 1.03 KB
/
FixedErrorBadge.qml
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
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Label {
id: self
property color backgroundColor: '#69302E'
property bool pointer: true
property var error
function clear() {
self.error = undefined
}
visible: self.text !== ''
text: self.error ? (self.error.startsWith('id_') ? qsTrId(self.error) : self.error) : ''
scale: self.error ? 1 : 0
Behavior on scale {
SmoothedAnimation {
velocity: 4
}
}
color: '#FFF'
font.pixelSize: 16
font.weight: 700
topPadding: 4
bottomPadding: 4
leftPadding: 16
rightPadding: 16
background: Rectangle {
radius: 4
color: self.backgroundColor
Item {
visible: pointer
x: parent.width / 2
Rectangle {
width: 8
height: 8
rotation: 45
color: constants.r500
transformOrigin: Item.Center
anchors.centerIn: parent
}
}
}
}