Created
August 25, 2016 07:42
-
-
Save bzar/a26f162385318288fd30b8ed3c4bcb37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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