File tree Expand file tree Collapse file tree 2 files changed +59
-10
lines changed Expand file tree Collapse file tree 2 files changed +59
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,32 @@ AbstractButton {
14
14
property url iconSource: " "
15
15
16
16
padding: 0
17
- background: null
17
+ background: Rectangle {
18
+ id: bg
19
+ height: root .height
20
+ width: root .width
21
+ radius: 5
22
+ state: " DEFAULT"
23
+
24
+ states: [
25
+ State {
26
+ name: " DEFAULT"
27
+ PropertyChanges { target: bg; color: Theme .color .background }
28
+ },
29
+ State {
30
+ name: " HOVER"
31
+ PropertyChanges { target: bg; color: Theme .color .neutral2 }
32
+ },
33
+ State {
34
+ name: " PRESSED"
35
+ PropertyChanges { target: bg; color: Theme .color .neutral3 }
36
+ }
37
+ ]
38
+
39
+ Behavior on color {
40
+ ColorAnimation { duration: 150 }
41
+ }
42
+ }
18
43
contentItem: RowLayout {
19
44
anchors .fill : parent
20
45
spacing: 0
@@ -33,7 +58,6 @@ AbstractButton {
33
58
icon .height : root .iconHeight
34
59
icon .width : root .iconWidth
35
60
background: null
36
- onClicked: root .clicked ()
37
61
}
38
62
}
39
63
Loader {
@@ -52,8 +76,24 @@ AbstractButton {
52
76
color: Theme .color .neutral9
53
77
text: root .text
54
78
}
55
- onClicked: root .clicked ()
56
79
}
57
- }
80
+ }
81
+ }
82
+ MouseArea {
83
+ anchors .fill : parent
84
+ hoverEnabled: true
85
+ onEntered: {
86
+ root .background .state = " HOVER"
87
+ }
88
+ onExited: {
89
+ root .background .state = " DEFAULT"
90
+ }
91
+ onPressed: {
92
+ root .background .state = " PRESSED"
93
+ }
94
+ onReleased: {
95
+ root .background .state = " DEFAULT"
96
+ root .clicked ()
97
+ }
58
98
}
59
99
}
Original file line number Diff line number Diff line change @@ -48,8 +48,11 @@ Item {
48
48
Setting {
49
49
Layout .fillWidth : true
50
50
header: qsTr (" About" )
51
- actionItem: NavButton {
52
- iconSource: " image://images/caret-right"
51
+ actionItem: Button {
52
+ icon .source : " image://images/caret-right"
53
+ icon .color : Theme .color .neutral9
54
+ icon .height : 18
55
+ icon .width : 18
53
56
background: null
54
57
onClicked: {
55
58
nodeSettingsView .push (about_page)
@@ -59,8 +62,11 @@ Item {
59
62
Setting {
60
63
Layout .fillWidth : true
61
64
header: qsTr (" Storage" )
62
- actionItem: NavButton {
63
- iconSource: " image://images/caret-right"
65
+ actionItem: Button {
66
+ icon .source : " image://images/caret-right"
67
+ icon .color : Theme .color .neutral9
68
+ icon .height : 18
69
+ icon .width : 18
64
70
background: null
65
71
onClicked: {
66
72
nodeSettingsView .push (storage_page)
@@ -70,8 +76,11 @@ Item {
70
76
Setting {
71
77
Layout .fillWidth : true
72
78
header: qsTr (" Connection" )
73
- actionItem: NavButton {
74
- iconSource: " image://images/caret-right"
79
+ actionItem: Button {
80
+ icon .source : " image://images/caret-right"
81
+ icon .color : Theme .color .neutral9
82
+ icon .height : 18
83
+ icon .width : 18
75
84
background: null
76
85
onClicked: {
77
86
nodeSettingsView .push (connection_page)
You can’t perform that action at this time.
0 commit comments