File tree Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Original file line number Diff line number Diff line change 5
5
import QtQuick 2.15
6
6
import QtQuick.Controls 2.15
7
7
8
- TextEdit {
8
+ Control {
9
9
id: root
10
10
required property string parentState
11
11
property string description: " "
12
12
property int descriptionSize: 18
13
13
property color textColor
14
14
state: root .parentState
15
+ signal editingFinished ()
16
+ focusPolicy: Qt .StrongFocus
17
+
18
+ contentItem: TextEdit {
19
+ font .family : " Inter"
20
+ font .styleName : " Regular"
21
+ font .pixelSize : root .descriptionSize
22
+ color: root .textColor
23
+ text: root .description
24
+ horizontalAlignment: Text .AlignRight
25
+ wrapMode: Text .WordWrap
26
+ onEditingFinished: editingFinished ()
27
+ }
15
28
16
29
states: [
17
30
State {
@@ -28,15 +41,17 @@ TextEdit {
28
41
}
29
42
]
30
43
31
- font .family : " Inter"
32
- font .styleName : " Regular"
33
- font .pixelSize : root .descriptionSize
34
- color: root .textColor
35
- text: description
36
- horizontalAlignment: Text .AlignRight
37
- wrapMode: Text .WordWrap
38
-
39
- Behavior on color {
44
+ Behavior on textColor {
40
45
ColorAnimation { duration: 150 }
41
46
}
47
+
48
+ background: Rectangle {
49
+ visible: root .visualFocus
50
+ anchors .fill : parent
51
+ anchors .margins : - 4
52
+ border .width : 2
53
+ border .color : Theme .color .purple
54
+ radius: 9
55
+ color: " transparent"
56
+ }
42
57
}
You can’t perform that action at this time.
0 commit comments