blob: 194424c2547c5a49bb8410e856d073a3ef719fe3 [file] [log] [blame]
swissChilid2af6ad2022-04-16 14:42:17 -07001import QtQuick 2.0
2import QtQuick.Layouts 1.12
3import QtQuick.Controls 2.0
4
5RowLayout {
6 id: root
7
8 property string name: "Hello.refnb"
9 property alias containsMouse: mouseArea.containsMouse
10 signal clicked()
swissChilia44bf722022-04-16 18:41:54 -070011 signal removeClicked()
swissChilid2af6ad2022-04-16 14:42:17 -070012
13 Image {
14 id: nbIcon
15 width: 100
16 height: 100
17 source: "qrc:///icons/document.svg"
18 fillMode: Image.PreserveAspectFit
19 }
20
21 Label {
22 text: name
23 Layout.fillWidth: true
24
25 MouseArea {
26 id: mouseArea
27
28 anchors.fill: parent
29 hoverEnabled: true
30
swissChilia44bf722022-04-16 18:41:54 -070031 acceptedButtons: Qt.LeftButton | Qt.RightButton
32
33 onClicked: {
34 if (mouse.button == Qt.LeftButton)
35 root.clicked();
36 else if (mouse.button == Qt.RightButton)
37 contextMenu.popup();
38 }
39 }
40
41 Menu {
42 id: contextMenu
43
44 MenuItem {
45 text: qsTr("Remove")
46
47 onClicked: root.removeClicked()
48 }
swissChilid2af6ad2022-04-16 14:42:17 -070049 }
50 }
51}
52
53/*##^##
54Designer {
55 D{i:0;autoSize:true;height:24;width:300}
56}
57##^##*/