2014-08-19 15:37:24 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
|
|
|
|
Item {
|
2014-08-27 13:18:08 +00:00
|
|
|
property string picture
|
2014-08-19 15:37:24 +00:00
|
|
|
property bool selected: false
|
|
|
|
property bool hovered: false
|
|
|
|
|
|
|
|
width: image.width + 10
|
|
|
|
height: image.height + 10
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: glow
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "white"
|
|
|
|
radius: 8
|
|
|
|
|
|
|
|
opacity: parent.selected ? 1.0 : (parent.hovered ? 0.5 : 0.0)
|
|
|
|
Behavior on opacity {
|
|
|
|
PropertyAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: image
|
2014-08-27 13:18:08 +00:00
|
|
|
source: parent.picture
|
2014-08-19 15:37:24 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
onEntered: parent.hovered = true
|
|
|
|
onExited: parent.hovered = false
|
|
|
|
onClicked: parent.selected = true
|
|
|
|
}
|
|
|
|
}
|