diff options
| author | marcin <z.krzysztoff7@gmail.com> | 2014-07-07 19:08:30 +0200 |
|---|---|---|
| committer | marcin <z.krzysztoff7@gmail.com> | 2014-07-07 19:08:30 +0200 |
| commit | 62df25ce8e090f53aef822c2b22c754fd4fca3e1 (patch) | |
| tree | cf7af7fb5e3700dc26599f46aebf6676cb832a21 /components/StandardButton.qml | |
| download | monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.tar.gz monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.tar.xz monzero-gui-62df25ce8e090f53aef822c2b22c754fd4fca3e1.zip | |
first push
Diffstat (limited to 'components/StandardButton.qml')
| -rw-r--r-- | components/StandardButton.qml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/components/StandardButton.qml b/components/StandardButton.qml new file mode 100644 index 00000000..027356e8 --- /dev/null +++ b/components/StandardButton.qml @@ -0,0 +1,46 @@ +import QtQuick 2.0 + +Item { + height: 37 + property string shadowColor + property string pressedColor + property string releasedColor + property string textColor: "#FFFFFF" + property alias text: label.text + signal clicked() + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + height: parent.height - 1 + y: buttonArea.pressed ? 1 : 0 + radius: 4 + color: parent.shadowColor + } + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + height: parent.height - 1 + y: buttonArea.pressed ? 0 : 1 + color: buttonArea.pressed ? parent.pressedColor : parent.releasedColor + radius: 4 + } + + Text { + id: label + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: Text.AlignHCenter + elide: Text.ElideRight + font.pixelSize: 12 + color: parent.textColor + } + + MouseArea { + id: buttonArea + anchors.fill: parent + onClicked: parent.clicked() + } +} |
