blob: fd7d8b90f92261bcf2d4547464541c723d49846e [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
14 Layout.topMargin: 14
15 Layout.bottomMargin: 14
16
17 transitions: Transition {
18 NumberAnimation {
19 property: "opacity"
20 duration: 100
21 easing.type: Easing.OutCubic
22 }
23 }
24
25 MouseArea {
26 id: mouseArea
27 height: 30
28 width: parent.width
29 anchors.centerIn: parent
30 hoverEnabled: true
31
32 states: [
33 State {
34 when: mouseArea.containsMouse
35 PropertyChanges {
36 target: root
37 opacity: 1
38 }
39 },
40 State {
41 when: !mouseArea.containsMouse
42 PropertyChanges {
43 target: root
44 opacity: 0
45 }
46 }
47 ]
48 }
49
50 Item {
51 id: insertRow
52 anchors.centerIn: parent
53 height: 24
54 width: 24
55
swissChili25620b02022-02-23 17:15:16 -080056 RoundButton {
swissChili23958ca2022-02-21 19:23:34 -080057 id: addButton
58 anchors.centerIn: parent
59 icon.source: "qrc:///icons/add.svg"
swissChili4b3105a2022-02-22 16:34:39 -080060 icon.color: Material.color(Material.Grey, Material.theme == Material.Dark ? Material.Shade400 : Material.Shade600)
swissChili23958ca2022-02-21 19:23:34 -080061 flat: true
swissChili25620b02022-02-23 17:15:16 -080062
63 onClicked: root.insertClicked()
swissChili23958ca2022-02-21 19:23:34 -080064 }
65 }
66}