File tree Expand file tree Collapse file tree 7 files changed +35
-114
lines changed Expand file tree Collapse file tree 7 files changed +35
-114
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Button {
10
10
font .family : " Inter"
11
11
font .styleName : " Semi Bold"
12
12
font .pixelSize : 18
13
+ hoverEnabled: true
13
14
contentItem: Text {
14
15
text: parent .text
15
16
font: parent .font
@@ -23,42 +24,20 @@ Button {
23
24
implicitWidth: 300
24
25
color: Theme .color .orange
25
26
radius: 5
26
- state: " DEFAULT"
27
27
28
28
states: [
29
29
State {
30
- name: " DEFAULT "
31
- PropertyChanges { target: bg; color: Theme .color .orange }
30
+ name: " PRESSED " ; when : root . pressed
31
+ PropertyChanges { target: bg; color: Theme .color .orangeLight2 }
32
32
},
33
33
State {
34
- name: " HOVER"
34
+ name: " HOVER" ; when : root . hovered
35
35
PropertyChanges { target: bg; color: Theme .color .orangeLight1 }
36
- },
37
- State {
38
- name: " PRESSED"
39
- PropertyChanges { target: bg; color: Theme .color .orangeLight2 }
40
36
}
41
37
]
42
38
43
39
Behavior on color {
44
40
ColorAnimation { duration: 150 }
45
41
}
46
42
}
47
- MouseArea {
48
- anchors .fill : parent
49
- hoverEnabled: true
50
- onEntered: {
51
- root .background .state = " HOVER"
52
- }
53
- onExited: {
54
- root .background .state = " DEFAULT"
55
- }
56
- onPressed: {
57
- root .background .state = " PRESSED"
58
- }
59
- onReleased: {
60
- root .background .state = " DEFAULT"
61
- root .clicked ()
62
- }
63
- }
64
43
}
Original file line number Diff line number Diff line change @@ -15,17 +15,17 @@ AbstractButton {
15
15
property url iconSource: " image://images/export"
16
16
property int iconWidth: 22
17
17
property int iconHeight: 22
18
- property color iconColor
19
- property color textColor
18
+ property color iconColor: Theme . color . neutral9
19
+ property color textColor: Theme . color . neutral7
20
20
state: root .parentState
21
21
22
22
states: [
23
23
State {
24
- name: " FILLED "
24
+ name: " ACTIVE "
25
25
PropertyChanges {
26
26
target: root
27
- iconColor: Theme .color .neutral9
28
- textColor: Theme .color .neutral7
27
+ iconColor: Theme .color .orange
28
+ textColor: Theme .color .orange
29
29
}
30
30
},
31
31
State {
@@ -35,14 +35,6 @@ AbstractButton {
35
35
iconColor: Theme .color .orangeLight1
36
36
textColor: Theme .color .orangeLight1
37
37
}
38
- },
39
- State {
40
- name: " ACTIVE"
41
- PropertyChanges {
42
- target: root
43
- iconColor: Theme .color .orange
44
- textColor: Theme .color .orange
45
- }
46
38
}
47
39
]
48
40
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ AbstractButton {
14
14
property url iconSource: " "
15
15
property Rectangle iconBackground: null
16
16
property color iconColor: Theme .color .neutral9
17
-
17
+ hoverEnabled : true
18
18
topPadding: text_background .active ? 7 : 14
19
19
bottomPadding: text_background .active ? 7 : 14
20
20
rightPadding: text_background .active ? 22 : 14
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Button {
10
10
font .family : " Inter"
11
11
font .styleName : " Semi Bold"
12
12
font .pixelSize : 18
13
+ hoverEnabled: true
13
14
contentItem: Text {
14
15
text: parent .text
15
16
font: parent .font
@@ -23,44 +24,24 @@ Button {
23
24
implicitWidth: 340
24
25
color: Theme .color .background
25
26
radius: 5
26
- state: " DEFAULT"
27
27
border {
28
28
width: 1
29
+ color: Theme .color .neutral6
30
+
29
31
Behavior on color {
30
32
ColorAnimation { duration: 150 }
31
33
}
32
34
}
33
-
34
- states: [
35
- State {
36
- name: " DEFAULT"
37
- PropertyChanges { target: bg; border .color : Theme .color .neutral6 }
38
- },
39
- State {
40
- name: " HOVER"
41
- PropertyChanges { target: bg; border .color : Theme .color .neutral9 }
42
- },
43
- State {
44
- name: " PRESSED"
45
- PropertyChanges { target: bg; border .color : Theme .color .orangeLight2 }
46
- }
47
- ]
48
35
}
49
- MouseArea {
50
- anchors .fill : parent
51
- hoverEnabled: true
52
- onEntered: {
53
- root .background .state = " HOVER"
54
- }
55
- onExited: {
56
- root .background .state = " DEFAULT"
57
- }
58
- onPressed: {
59
- root .background .state = " PRESSED"
60
- }
61
- onReleased: {
62
- root .background .state = " DEFAULT"
63
- root .clicked ()
36
+
37
+ states: [
38
+ State {
39
+ name: " PRESSED" ; when: root .pressed
40
+ PropertyChanges { target: bg; border .color : Theme .color .orangeLight2 }
41
+ },
42
+ State {
43
+ name: " HOVER" ; when: root .hovered
44
+ PropertyChanges { target: bg; border .color : Theme .color .neutral9 }
64
45
}
65
- }
46
+ ]
66
47
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ AbstractButton {
14
14
property alias loadedItem: action_loader .item
15
15
property string description
16
16
property color stateColor
17
+ hoverEnabled: true
17
18
state: " FILLED"
18
19
19
20
states: [
Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ import QtQuick.Controls 2.15
8
8
Button {
9
9
id: root
10
10
property int textSize: 18
11
- property color textColor
12
- property color bgColor
11
+ property color textColor: Theme . color . orange
12
+ property color bgColor: Theme . color . background
13
13
property bool bold: true
14
14
property bool rightalign: false
15
15
font .family : " Inter"
16
16
font .styleName : bold ? " Semi Bold" : " Regular"
17
17
font .pixelSize : root .textSize
18
18
padding: 15
19
- state : " DEFAULT "
19
+ hoverEnabled : true
20
20
contentItem: Text {
21
21
text: root .text
22
22
font: root .font
@@ -37,45 +37,20 @@ Button {
37
37
}
38
38
states: [
39
39
State {
40
- name: " DEFAULT "
40
+ name: " PRESSED " ; when : root . pressed
41
41
PropertyChanges {
42
42
target: root
43
- textColor: Theme .color .orange
44
- bgColor: Theme .color .background
43
+ textColor: Theme .color .orangeLight2
44
+ bgColor: Theme .color .neutral3
45
45
}
46
46
},
47
47
State {
48
- name: " HOVER"
48
+ name: " HOVER" ; when : root . hovered
49
49
PropertyChanges {
50
50
target: root
51
51
textColor: Theme .color .orangeLight1
52
52
bgColor: Theme .color .neutral2
53
53
}
54
- },
55
- State {
56
- name: " PRESSED"
57
- PropertyChanges {
58
- target: root
59
- textColor: Theme .color .orangeLight2
60
- bgColor: Theme .color .neutral3
61
- }
62
54
}
63
55
]
64
- MouseArea {
65
- anchors .fill : parent
66
- hoverEnabled: true
67
- onEntered: {
68
- root .state = " HOVER"
69
- }
70
- onExited: {
71
- root .state = " DEFAULT"
72
- }
73
- onPressed: {
74
- root .state = " PRESSED"
75
- }
76
- onReleased: {
77
- root .state = " DEFAULT"
78
- root .clicked ()
79
- }
80
- }
81
56
}
Original file line number Diff line number Diff line change @@ -10,26 +10,19 @@ TextInput {
10
10
required property string parentState
11
11
property string description: " "
12
12
property int descriptionSize: 18
13
- property color textColor
13
+ property color textColor: Theme .color .neutral9
14
+ enabled: true
14
15
state: root .parentState
15
16
16
17
states: [
17
18
State {
18
- name: " FILLED"
19
- PropertyChanges {
20
- target: root
21
- enabled: true
22
- textColor: Theme .color .neutral9
23
- }
19
+ name: " ACTIVE"
20
+ PropertyChanges { target: root; textColor: Theme .color .orange }
24
21
},
25
22
State {
26
23
name: " HOVER"
27
24
PropertyChanges { target: root; textColor: Theme .color .orangeLight1 }
28
25
},
29
- State {
30
- name: " ACTIVE"
31
- PropertyChanges { target: root; textColor: Theme .color .orange }
32
- },
33
26
State {
34
27
name: " DISABLED"
35
28
PropertyChanges {
You can’t perform that action at this time.
0 commit comments