mathtrainingstuff/qml/components/GameButton.qml

38 lines
830 B
QML
Raw Permalink Normal View History

2018-12-19 20:30:50 +01:00
import QtQuick 2.0
import QtQuick.Controls 2.2
Button {
id: control
width: height
font.pixelSize: width * 0.15
scale: pressed ? 0.8:1
contentItem: Text {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
color: settings.theme("ButtonTextColor")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
background: Rectangle {
color: settings.theme("ButtonBackgroundColor")
radius: width * 0.5
border.color: settings.theme("ButtonBorderColor")
border.width: parseInt(settings.theme("ButtonBorderWidth"))
}
Behavior on scale {
NumberAnimation {
easing.type: Easing.InOutQuad
duration: 200
}
}
}