added about dialog to qml
[panucci.git] / data / ui / qml / SelectableItem.qml
blob4e50f6aa4bb8a6f9f37e46af19a5eb841d000d61
2 import Qt 4.7
4 import 'config.js' as Config
6 Item {
7     id: selectableItem
8     signal selected(variant item)
9     signal contextMenu(variant item)
11     height: Config.listItemHeight
12     width: parent.width
14     Rectangle {
15         id: highlight
16         opacity: mouseArea.pressed?.2:0
17         color: "white"
18         anchors.fill: parent
20         Behavior on opacity { NumberAnimation { duration: Config.slowTransition } }
21     }
23     MouseArea {
24         id: mouseArea
25         acceptedButtons: Qt.LeftButton | Qt.RightButton
26         anchors.fill: parent
27         onClicked: {
28             if (mouse.button == Qt.LeftButton) {
29                 selectableItem.selected(modelData)
30             } else if (mouse.button == Qt.RightButton) {
31                 selectableItem.contextMenu(modelData)
32             }
33         }
34         onPressAndHold: selectableItem.contextMenu(modelData)
35     }