1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, http://www.bibletime.info/.
6*
7* Copyright 1999-2016 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12import QtQuick 2.2
13import BibleTime 1.0
14
15Rectangle {
16    id: contextMenu
17
18    property alias model: menuList.model
19
20    signal accepted(string action)
21
22    color: "white"
23    border.color: "black"
24    border.width: 1
25    anchors.centerIn: parent
26    height: 250
27    width: 250
28
29    onVisibleChanged: PropertyAnimation {
30        target: settings
31        property: "opacity"
32        from: 0
33        to: 1
34        duration: 400
35        easing.type: Easing.InOutCubic
36    }
37
38    BtStyle {
39        id: btStyle
40    }
41
42    ListView {
43        id: menuList
44
45        anchors.fill: parent
46        anchors.topMargin: 100
47
48        delegate: Rectangle {
49            color: "white"
50            border.color: "black"
51            border.width: 1
52            width: parent.width
53            height: children[0].height * 2.5
54
55            Text {
56                id: menuText
57                x: 40
58                anchors.verticalCenter: parent.verticalCenter
59                text: title
60                color: "black"
61                font.pointSize: btStyle.uiFontPointSize
62            }
63
64            MouseArea {
65                anchors.fill: parent
66                onClicked: {
67                    contextMenu.visible = false;
68                    contextMenu.accepted(action);
69                }
70            }
71        }
72    }
73}
74