swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 1 | import QtQuick 2.0 |
| 2 | import QtQuick.Controls 2.15 |
| 3 | import QtQuick.Controls.Material 2.0 |
| 4 | import QtQuick.Layouts 1.0 |
| 5 | |
| 6 | Rectangle { |
| 7 | id: root |
| 8 | |
swissChili | 25620b0 | 2022-02-23 17:15:16 -0800 | [diff] [blame] | 9 | signal insertClicked() |
| 10 | |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame] | 11 | color: Material.color(Material.Grey, Material.theme == Material.Dark ? Material.Shade800 : Material.Shade300) |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 12 | 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 | |
swissChili | 25620b0 | 2022-02-23 17:15:16 -0800 | [diff] [blame] | 56 | RoundButton { |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 57 | id: addButton |
| 58 | anchors.centerIn: parent |
| 59 | icon.source: "qrc:///icons/add.svg" |
swissChili | 4b3105a | 2022-02-22 16:34:39 -0800 | [diff] [blame] | 60 | icon.color: Material.color(Material.Grey, Material.theme == Material.Dark ? Material.Shade400 : Material.Shade600) |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 61 | flat: true |
swissChili | 25620b0 | 2022-02-23 17:15:16 -0800 | [diff] [blame] | 62 | |
| 63 | onClicked: root.insertClicked() |
swissChili | 23958ca | 2022-02-21 19:23:34 -0800 | [diff] [blame] | 64 | } |
| 65 | } |
| 66 | } |