Friendiqa/source-android/qml/genericqml/BlueButton.qml

42 lines
966 B
QML
Raw Normal View History

2017-01-26 21:55:31 +01:00
import QtQuick 2.0
Rectangle{
id: blueButton
2017-03-25 23:36:14 +01:00
width: Math.max(mainText.width+2*mm,8*mm)
height: 5*mm
2017-01-26 21:55:31 +01:00
color:"light blue"
2017-03-25 23:36:14 +01:00
property alias fontColor: mainText.color
2017-01-26 21:55:31 +01:00
border.color:"grey"
border.width:1
radius: mm
property alias text: mainText.text
signal clicked
state:""
Text{
id:mainText
color: "black"
anchors.centerIn: parent
width: contentWidth
height: contentHeight
2017-03-25 23:36:14 +01:00
font.family:fontAwesome.name
2017-01-26 21:55:31 +01:00
font.pixelSize: 3*mm
text: ""
}
MouseArea{
id:buttonArea
anchors.fill:parent
onPressed: blueButton.state="Pressed"
onReleased: blueButton.state=""
onClicked: {parent.clicked()}
}
states: [
State { name: "Pressed"
PropertyChanges { target: blueButton; color: "sky blue"} }
2017-01-26 21:55:31 +01:00
]
transitions: [
Transition { to:"*"
ColorAnimation { target: blueButton; duration: 100} }
]
}