2014-07-07 20:08:30 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
height: 37
|
2014-07-09 18:44:13 +03:00
|
|
|
property string shadowPressedColor
|
|
|
|
property string shadowReleasedColor
|
2014-07-07 20:08:30 +03:00
|
|
|
property string pressedColor
|
|
|
|
property string releasedColor
|
2014-07-09 17:18:48 +03:00
|
|
|
property string icon: ""
|
2014-07-07 20:08:30 +03:00
|
|
|
property string textColor: "#FFFFFF"
|
|
|
|
property alias text: label.text
|
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: parent.height - 1
|
2014-07-09 18:44:13 +03:00
|
|
|
y: buttonArea.pressed ? 0 : 1
|
2014-07-17 14:14:27 +03:00
|
|
|
//radius: 4
|
2014-07-09 18:44:13 +03:00
|
|
|
color: buttonArea.pressed ? parent.shadowPressedColor : parent.shadowReleasedColor
|
2014-07-07 20:08:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: parent.height - 1
|
2014-07-09 18:44:13 +03:00
|
|
|
y: buttonArea.pressed ? 1 : 0
|
2014-07-07 20:08:30 +03:00
|
|
|
color: buttonArea.pressed ? parent.pressedColor : parent.releasedColor
|
2014-07-17 14:14:27 +03:00
|
|
|
//radius: 4
|
2014-07-07 20:08:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: label
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
elide: Text.ElideRight
|
2014-07-09 18:44:13 +03:00
|
|
|
font.family: "Arial"
|
|
|
|
font.bold: true
|
|
|
|
font.letterSpacing: -1
|
2014-07-07 20:08:30 +03:00
|
|
|
font.pixelSize: 12
|
|
|
|
color: parent.textColor
|
2014-07-09 17:18:48 +03:00
|
|
|
visible: parent.icon === ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: parent.icon !== ""
|
|
|
|
source: parent.icon
|
2014-07-07 20:08:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: buttonArea
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: parent.clicked()
|
|
|
|
}
|
|
|
|
}
|