-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditTextLabel4421.qml
85 lines (76 loc) · 1.75 KB
/
EditTextLabel4421.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import QtQuick 1.1
import BasicUIControls 1.0
Item {
id: editTextLabel
width: 430
height: defaultHeight
property int defaultHeight: 36
property string leftText
property string inputText
property alias inputTextFormat: labelInput.textFormat
property int leftTextAvailableWidth: 127
property real leftTextImplicitWidth: labelTitle.implicitWidth + labelTitle.anchors.leftMargin
property alias labelFontFamily: labelTitle.font.family
property alias labelFontSize: labelTitle.font.pixelSize
property string kpiPostfix: leftText ? leftText : "editTextLabel"
signal clicked()
StyledRectangle {
anchors.fill: parent
color: "#ffffff"
radius: colors.labelRadius
leftClickMargin: 10
topClickMargin: 3
bottomClickMargin: 3
onClicked: editTextLabel.clicked()
Rectangle {
id: labelField
color: "#F0F0F0"
radius: colors.labelRadius
anchors {
fill: parent
leftMargin: leftText == "" ? anchors.rightMargin : leftTextAvailableWidth + labelTitle.anchors.rightMargin
topMargin: 5
rightMargin: 5
bottomMargin: 5
}
border {
width: 1
color: "#F0F0F0"
}
Text {
id: labelInput
anchors {
left: parent.left
right: parent.right
leftMargin: 5
rightMargin: anchors.leftMargin
verticalCenter: parent.verticalCenter
}
font {
family: qfont.regular.name
pixelSize: qfont.bodyText
}
elide: Text.ElideRight
text: inputText
color: "#000000"
}
}
Text {
id: labelTitle
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 10
right: labelField.left
rightMargin: 10
}
font {
family: qfont.semiBold.name
pixelSize: qfont.titleText
}
elide: Text.ElideRight
text: leftText
color: "#000000"
}
}
}