2017-06-22 09:45:47 +00:00
|
|
|
import QtQuick 2.0
|
2017-12-05 20:53:47 +00:00
|
|
|
import "."
|
2017-06-22 09:45:47 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property string text
|
|
|
|
property string hoverText: ""
|
|
|
|
|
|
|
|
signal clicked
|
|
|
|
|
2017-12-05 20:53:47 +00:00
|
|
|
width: Style.strutSize * 2
|
2017-10-13 15:48:24 +00:00
|
|
|
height: buttonText.implicitHeight + (radius * 2)
|
2017-12-05 20:53:47 +00:00
|
|
|
radius: Style.roundRadius
|
2017-06-22 09:45:47 +00:00
|
|
|
|
2017-12-05 20:53:47 +00:00
|
|
|
color: mouse.containsMouse ? Style.activeColor : Style.themeColor
|
2017-06-22 09:45:47 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|