2
* This file is part of unity-2d
4
* Copyright 2012 Canonical Ltd.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
import "../common/utils.js" as Utils
26
source: "Launcher.qml"
27
property variant visibilityController: visibilityController
28
onLoaded: item.focus = true
29
property alias outerEdgeMouseArea: outerEdge
31
VisibilityController {
32
id: visibilityController
33
behavior: launcherBehavior.status == Loader.Ready ? launcherBehavior.item : null
39
property variant modesMap: { 0: '../common/visibilityBehaviors/AlwaysVisibleBehavior.qml',
40
1: '../common/visibilityBehaviors/AutoHideBehavior.qml',
41
2: '../common/visibilityBehaviors/IntelliHideBehavior.qml' }
43
source: modesMap[Utils.clamp(launcher2dConfiguration.hideMode, 0, 2)]
47
target: launcherBehavior
48
property: "item.target"
49
value: launcherLoader.item
50
when: launcherBehavior.status == Loader.Ready
54
target: declarativeView
55
property: "monitoredArea"
56
value: Qt.rect(launcherLoader.x, launcherLoader.item.y, launcherLoader.item.width, launcherLoader.item.height)
57
when: launcherBehavior.status == Loader.Ready && !launcherLoaderXAnimation.running
61
target: launcherBehavior.item
62
property: "forcedVisible"
63
value: visibilityController.forceVisible
67
target: launcherBehavior.item
68
property: "forcedVisibleChangeId"
69
value: visibilityController.forceVisibleChangeId
73
target: declarativeView
74
onSuperKeyHeldChanged: {
75
if (superKeyHeld) visibilityController.beginForceVisible()
76
else visibilityController.endForceVisible()
81
target: launcherLoader.item
82
property: "outerEdgeContainsMouse"
83
value: outerEdge.containsMouse && outerEdge.enabled
90
hoverEnabled: !visibilityController.shown
91
enabled: !visibilityController.shown