Add sample qml application
[staging/HomeScreen.git] / sample-qml / imports / components / OutShadow.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 QtGraphicalEffects 1.0
9
10 Item {
11     id: root
12
13     anchors.fill: parent
14     property alias color: shadow.color
15     property alias radius: shadow.radius
16
17     Item {
18         id: shadowTarget
19         x: -radius
20         y: -radius
21         width: parent.width + 2 * radius
22         height: parent.height + 2 * radius
23
24         Rectangle {
25             anchors.centerIn: parent
26             width: root.width
27             height: root.height
28             color: "black"
29         }
30     }
31
32     DropShadow {
33         id: shadow
34         anchors.fill: shadowTarget
35         horizontalOffset: 0
36         verticalOffset: 0
37         radius: 16
38         samples: 32
39         source: shadowTarget
40     }
41 }