2 * Copyright (C) 2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import QtQuick.Layouts 1.1
19 import Ubuntu.Components 1.3
20 import Ubuntu.Gestures 0.1
21 import "../Components"
25 property bool showHint: true
26 property int panelWidth: units.gu(40)
27 readonly property alias dragging: hideSideStageDragArea.dragging
28 readonly property real progress: width / panelWidth
34 id: sideStageDragHandle
42 opacity: root.shown ? 1 : 0
43 Behavior on opacity { UbuntuNumberAnimation {} }
46 anchors.centerIn: parent
47 width: hideSideStageDragArea.pressed ? parent.width * 2 : parent.width
49 source: "graphics/sidestage_handle@20.png"
50 Behavior on width { UbuntuNumberAnimation {} }
56 color: Qt.rgba(0,0,0,0.95)
60 anchors.verticalCenter: parent.verticalCenter
61 width: panelWidth - units.gu(6)
62 x: panelWidth/2 - width/2
69 anchors.horizontalCenter: parent.horizontalCenter
70 source: "graphics/sidestage_drag.svg"
71 color: enabled ? Qt.rgba(1,1,1,1) : Qt.rgba(1,0,0,1)
72 keyColor: Qt.rgba(1,1,1,1)
76 text: i18n.tr("Drag using 3 fingers any application from one window to the other")
78 wrapMode: Text.WordWrap
79 color: enabled ? Qt.rgba(1,1,1,1) : Qt.rgba(1,0,0,1)
83 showAnimation: NumberAnimation {
86 duration: UbuntuAnimation.BriskDuration
87 easing.type: Easing.OutCubic
90 hideAnimation: NumberAnimation {
93 duration: UbuntuAnimation.BriskDuration
94 easing.type: Easing.OutCubic
98 id: hideSideStageDragArea
99 objectName: "hideSideStageDragArea"
101 direction: Direction.Rightwards
103 anchors.right: root.left
104 width: sideStageDragHandle.width
108 immediateRecognition: true
109 maxTotalDragDistance: panelWidth
110 autoCompleteDragThreshold: panelWidth / 2
113 // SideStage mouse event eater