This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/widgets/SimpleButton.qml

37 lines
699 B
QML
Raw Normal View History

2018-10-23 18:52:13 +00:00
import QtQuick 2.0
Rectangle {
id: button
width: buttonText.width + 20
height: 20
2018-10-28 02:49:14 +00:00
color: "#4B3557"
//border.color: focus ? "#BBBBBB" : "#AAAAAA"
//border.width: 1
2018-10-23 18:52:13 +00:00
radius: 2
antialiasing: true
property bool checked: false
property alias text: buttonText.text
2018-10-28 02:49:14 +00:00
property alias font: buttonText.font.family
2018-10-23 18:52:13 +00:00
signal clicked
Text {
id: buttonText
anchors.centerIn: parent
font.pixelSize: parent.height * .5
2018-10-28 02:49:14 +00:00
color: "#FFFFFF"
2018-10-23 18:52:13 +00:00
}
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: {
parent.focus = true
parent.clicked()
}
}
Keys.onSpacePressed: clicked()
}