Add sample qml application
[staging/HomeScreen.git] / sample-qml / imports / components / BoxButton.qml
1 /* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
2  *
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 import QtQuick 2.0
8 import components 1.0
9
10 Item {
11     id: root
12
13     property alias shadow: box.shadow
14     property alias color: box.color
15     property alias text: textItem.text
16
17     signal clicked()
18
19     Box {
20         id: box
21         anchors.fill: parent
22
23         Text {
24             id: textItem
25             anchors.centerIn: parent
26             horizontalAlignment: Text.AlignHCenter
27             font.pixelSize: 28
28             color: "white"
29         }
30
31         MouseArea {
32             anchors.fill: parent
33             onClicked: root.clicked()
34         }
35     }
36 }