1
0
Fork 0
flightgear/src/GUI/Button.qml

35 lines
605 B
QML
Raw Normal View History

import QtQuick 2.0
Rectangle {
id: root
property string text
property string hoverText: ""
signal clicked
width: 120
height: buttonText.implicitHeight + (radius * 2)
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();
}
}
}