2017-06-22 09:45:47 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property string text
|
|
|
|
property string hoverText: ""
|
|
|
|
|
|
|
|
signal clicked
|
|
|
|
|
|
|
|
width: 120
|
2017-10-13 15:48:24 +00:00
|
|
|
height: buttonText.implicitHeight + (radius * 2)
|
2017-06-22 09:45:47 +00:00
|
|
|
radius: 6
|
|
|
|
|
|
|
|
color: mouse.containsMouse ? "#064989" : "#1b7ad3"
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: buttonText
|
|
|
|
anchors.centerIn: parent
|
|
|
|
color: "white"
|
|
|
|
text: (mouse.containsMouse && hoverText != "") ? root.hoverText : root.text
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouse
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
root.clicked();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|