2018-02-15 08:57:36 -05:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: button
|
|
|
|
|
|
|
|
property color backgroundAtRest: "#9e9e9e"
|
|
|
|
property color backgroundActive: "#555555"
|
|
|
|
|
|
|
|
property string buttonText: "Button"
|
|
|
|
|
|
|
|
function actionOnClick() { }
|
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
width: parent.width - 50
|
2018-02-22 08:03:26 -05:00
|
|
|
height: parent.parent.height * 0.1
|
2018-02-15 08:57:36 -05:00
|
|
|
radius: 10
|
|
|
|
|
|
|
|
color: backgroundAtRest
|
|
|
|
|
|
|
|
border.color: "#333333"
|
|
|
|
border.width: 2
|
|
|
|
|
2018-02-16 19:51:45 -05:00
|
|
|
antialiasing: true
|
2018-02-15 08:57:36 -05:00
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
transparentBorder: true
|
|
|
|
horizontalOffset: 5
|
|
|
|
verticalOffset: 5
|
|
|
|
radius: 5.0
|
|
|
|
samples: 5
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: buttonText
|
2018-02-22 08:03:26 -05:00
|
|
|
font.pointSize: parent.height * 0.2
|
2018-02-15 08:57:36 -05:00
|
|
|
font.bold: true
|
|
|
|
height: 30
|
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: button.color = backgroundActive
|
|
|
|
onReleased: button.color = backgroundAtRest
|
|
|
|
onClicked: actionOnClick()
|
|
|
|
}
|
|
|
|
}
|