diff options
Diffstat (limited to 'prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml')
-rw-r--r-- | prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml b/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml deleted file mode 100644 index 47c032b..0000000 --- a/prototype_2016/third_party/qml-material/src/components/OverlayLayer.qml +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * QML Material - An application framework implementing Material Design. | ||
3 | * | ||
4 | * Copyright (C) 2015-2016 Michael Spencer <sonrisesoftware@gmail.com> | ||
5 | * | ||
6 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
7 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
8 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
9 | */ | ||
10 | |||
11 | import QtQuick 2.4 | ||
12 | |||
13 | /*! | ||
14 | \qmltype OverlayLayer | ||
15 | \inqmlmodule Material | ||
16 | |||
17 | \brief Provides a layer to display popups and other overlay components. | ||
18 | */ | ||
19 | Rectangle { | ||
20 | id: overlayLayer | ||
21 | objectName: "overlayLayer" | ||
22 | |||
23 | anchors.fill: parent | ||
24 | |||
25 | property Item currentOverlay | ||
26 | color: "transparent" | ||
27 | |||
28 | onEnabledChanged: { | ||
29 | if (!enabled && overlayLayer.currentOverlay != null) | ||
30 | overlayLayer.currentOverlay.close() | ||
31 | } | ||
32 | |||
33 | onWidthChanged: closeIfNecessary() | ||
34 | onHeightChanged: closeIfNecessary() | ||
35 | |||
36 | states: State { | ||
37 | name: "ShowState" | ||
38 | when: overlayLayer.currentOverlay != null | ||
39 | |||
40 | PropertyChanges { | ||
41 | target: overlayLayer | ||
42 | color: currentOverlay.overlayColor | ||
43 | } | ||
44 | } | ||
45 | |||
46 | transitions: Transition { | ||
47 | ColorAnimation { | ||
48 | duration: 300 | ||
49 | easing.type: Easing.InOutQuad | ||
50 | } | ||
51 | } | ||
52 | |||
53 | function closeIfNecessary() { | ||
54 | if (overlayLayer.currentOverlay != null && overlayLayer.currentOverlay.closeOnResize) | ||
55 | overlayLayer.currentOverlay.close() | ||
56 | } | ||
57 | |||
58 | MouseArea { | ||
59 | anchors.fill: parent | ||
60 | enabled: overlayLayer.currentOverlay != null && | ||
61 | overlayLayer.currentOverlay.globalMouseAreaEnabled | ||
62 | hoverEnabled: enabled | ||
63 | |||
64 | onWheel: wheel.accepted = true | ||
65 | |||
66 | onClicked: { | ||
67 | if (overlayLayer.currentOverlay.dismissOnTap) | ||
68 | overlayLayer.currentOverlay.close() | ||
69 | } | ||
70 | } | ||
71 | } | ||