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/>.
18import QtQuick.Layouts 1.1
19import Lomiri.Components 1.3
20import Lomiri.Gestures 0.1
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
29 readonly property real handleWidth: units.gu(2)
35 id: sideStageDragHandle
37 opacity: root.shown ? 1 : 0
38 Behavior on opacity { LomiriNumberAnimation {} }
45 width: root.handleWidth
46 active: hideSideStageDragArea.pressed
50 anchors.centerIn: parent
51 width: hideSideStageDragArea.pressed ? parent.width * 3 : parent.width * 2
53 source: "graphics/sidestage_handle@20.png"
54 Behavior on width { LomiriNumberAnimation {} }
60 color: Qt.rgba(0,0,0,0.95)
64 anchors.verticalCenter: parent.verticalCenter
65 width: panelWidth - units.gu(6)
66 x: panelWidth/2 - width/2
73 anchors.horizontalCenter: parent.horizontalCenter
74 source: "graphics/sidestage_drag.svg"
75 color: enabled ? Qt.rgba(1,1,1,1) : Qt.rgba(1,0,0,1)
76 keyColor: Qt.rgba(1,1,1,1)
80 text: i18n.tr("Drag using 3 fingers any application from one window to the other")
82 wrapMode: Text.WordWrap
83 color: enabled ? Qt.rgba(1,1,1,1) : Qt.rgba(1,0,0,1)
87 showAnimation: NumberAnimation {
90 duration: LomiriAnimation.BriskDuration
91 easing.type: Easing.OutCubic
94 hideAnimation: NumberAnimation {
97 duration: LomiriAnimation.BriskDuration
98 easing.type: Easing.OutCubic
102 id: hideSideStageDragArea
103 objectName: "hideSideStageDragArea"
105 direction: Direction.Rightwards
107 anchors.right: root.left
108 width: sideStageDragHandle.width
112 immediateRecognition: true
113 maxTotalDragDistance: panelWidth
114 autoCompleteDragThreshold: panelWidth / 2
117 // SideStage mouse event eater