File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,42 @@ AbstractButton {
13
13
property alias actionItem: action_loader .sourceComponent
14
14
property alias loadedItem: action_loader .item
15
15
property string description
16
+ property color stateColor
17
+ state: " FILLED"
18
+
19
+ states: [
20
+ State {
21
+ name: " FILLED"
22
+ PropertyChanges { target: root; stateColor: Theme .color .neutral9 }
23
+ },
24
+ State {
25
+ name: " HOVER"
26
+ PropertyChanges { target: root; stateColor: Theme .color .orangeLight1 }
27
+ },
28
+ State {
29
+ name: " ACTIVE"
30
+ PropertyChanges { target: root; stateColor: Theme .color .orange }
31
+ }
32
+ ]
33
+
34
+ MouseArea {
35
+ id: mouseArea
36
+ anchors .fill : root
37
+ hoverEnabled: true
38
+ onEntered: {
39
+ root .state = " HOVER"
40
+ }
41
+ onExited: {
42
+ root .state = " FILLED"
43
+ }
44
+ onPressed: {
45
+ root .state = " ACTIVE"
46
+ }
47
+ onReleased: {
48
+ root .state = " HOVER"
49
+ root .clicked ()
50
+ }
51
+ }
16
52
17
53
contentItem: ColumnLayout {
18
54
spacing: 20
@@ -23,6 +59,7 @@ AbstractButton {
23
59
center: false
24
60
header: root .header
25
61
headerSize: 18
62
+ headerColor: root .stateColor
26
63
description: root .description
27
64
descriptionSize: 15
28
65
descriptionMargin: 0
You can’t perform that action at this time.
0 commit comments