Skip to content

Instantly share code, notes, and snippets.

@bzar
Created August 25, 2016 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzar/a26f162385318288fd30b8ed3c4bcb37 to your computer and use it in GitHub Desktop.
Save bzar/a26f162385318288fd30b8ed3c4bcb37 to your computer and use it in GitHub Desktop.
import QtQuick 2.0
Rectangle {
property color unpressedColor: "gray"
property color pressedColor: "lightgray"
property alias pressed: ma.pressed
property alias text: label.text
property real size: 1
signal clicked()
width: 24
height: 32
color: pressed ? pressedColor : unpressedColor
MouseArea {
id: ma
anchors.fill: parent
onClicked: parent.clicked()
}
Text {
id: label
font.bold: true
color: "white"
antialiasing: true
style: Text.Raised
anchors.centerIn: parent
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment