import Qt 4.7
+import ColorizeEffect 1.0
Rectangle {
id: background
property alias image: image.source
property alias text: text.text
+ property bool enabled: true
property int margins: 5
signal buttonClicked()
anchors { left: contents.left; leftMargin: 1; verticalCenter: contents.verticalCenter; verticalCenterOffset: 1}
width: sourceSize.width
height: sourceSize.height
+ effect: Colorize { id: imageColorize; color: "black"; strength: 0 }
}
Text {
id: text
color: "#aaaaaa"
- font.pixelSize: 18
smooth: true
height: paintedHeight
width: paintedWidth
target: background
color: palette.highlight
}
+ },
+ State {
+ name: "disabled"
+ when: !enabled
+ PropertyChanges {
+ target: background
+ border.color: Qt.darker("#aaaaaa", 1.5)
+ }
+ PropertyChanges {
+ target: text
+ color: Qt.darker("#aaaaaa")
+ }
+ PropertyChanges {
+ target: imageColorize
+ strength: 1
+ }
+ PropertyChanges {
+ target: mouseArea
+ enabled: false
+ }
}
]
}