blob: ee4543076f86da9a91ec2cf4a25eb1a805bc10dd [file] [log] [blame]
swissChili23958ca2022-02-21 19:23:34 -08001import QtQuick 2.0
2import QtQuick.Controls 2.15
3import QtQuick.Controls.Material 2.0
4import QtQuick.Layouts 1.0
5
6Rectangle {
7 id: root
8
swissChili25620b02022-02-23 17:15:16 -08009 signal insertClicked()
10
swissChili4b3105a2022-02-22 16:34:39 -080011 color: Material.color(Material.Grey, Material.theme == Material.Dark ? Material.Shade800 : Material.Shade300)
swissChili23958ca2022-02-21 19:23:34 -080012 height: 2
13 Layout.fillWidth: true
swissChilie386bc72022-02-24 21:31:31 -080014 Layout.topMargin: 16
15 Layout.bottomMargin: 16
swissChili23958ca2022-02-21 19:23:34 -080016
17 transitions: Transition {
18 NumberAnimation {
19 property: "opacity"
20 duration: 100
21 easing.type: Easing.OutCubic
22 }
23 }
24
swissChilie386bc72022-02-24 21:31:31 -080025 states: [
26 State {
27 when: mouseArea.containsMouse || addButton.hovered
28 PropertyChanges {
29 target: root
30 opacity: 1
31 }
32 },
33 State {
34 when: !mouseArea.containsMouse && !addButton.hovered
35 PropertyChanges {
36 target: root
37 opacity: 0
38 }
39 }
40 ]
41
swissChili23958ca2022-02-21 19:23:34 -080042 MouseArea {
43 id: mouseArea
44 height: 30
45 width: parent.width
46 anchors.centerIn: parent
47 hoverEnabled: true
48
swissChilie386bc72022-02-24 21:31:31 -080049 propagateComposedEvents: true
swissChili23958ca2022-02-21 19:23:34 -080050 }
51
52 Item {
53 id: insertRow
54 anchors.centerIn: parent
55 height: 24
56 width: 24
57
swissChili25620b02022-02-23 17:15:16 -080058 RoundButton {
swissChili23958ca2022-02-21 19:23:34 -080059 id: addButton
60 anchors.centerIn: parent
61 icon.source: "qrc:///icons/add.svg"
swissChili06cec4e2022-02-24 19:04:32 -080062 icon.color: Constants.buttonGrey
swissChili23958ca2022-02-21 19:23:34 -080063 flat: true
swissChili25620b02022-02-23 17:15:16 -080064
65 onClicked: root.insertClicked()
swissChilie386bc72022-02-24 21:31:31 -080066
67 hoverEnabled: true
swissChili23958ca2022-02-21 19:23:34 -080068 }
69 }
70}