@@ -21,12 +21,14 @@ import "../Components/PanelState"
22Rectangle {
22Rectangle {
23 id: fakeRectangle
23 id: fakeRectangle
24− visible: opacity > 0 && target && !target.anyMaximized // we go from 0.2 to 0.6
24+ visible: opacity > 0 && target && !target.anyMaximized // we go from 0.2 to 0.5
25 enabled: visible
25 enabled: visible
26 color: "#ffffff"
26 color: "#ffffff"
27− border.width: units.dp(1)
27+ border.width: units.dp(2)
28 border.color: "#99ffffff"
28 border.color: "#99ffffff"
30+ scale: progress > 0 && progress <= hintThreshold ? MathUtils.projectValue(progress, 0.0, 1.0, 1, 2) : 1
31+ opacity: progress > 0 ? MathUtils.projectValue(progress, 0.0, 1.0, 0.2, 0.5) : 0
31 property int edge: -1 // Item.TransformOrigin
33 property int edge: -1 // Item.TransformOrigin
32 property var target // appDelegate
34 property var target // appDelegate
@@ -34,11 +36,12 @@ Rectangle {
34 property real appContainerWidth
36 property real appContainerWidth
35 property real appContainerHeight
37 property real appContainerHeight
39+ readonly property real hintThreshold: 0.1
37 readonly property bool targetDragging: target && target.moveHandler.dragging
40 readonly property bool targetDragging: target && target.moveHandler.dragging
39 // Edge push progress
42 // Edge push progress
40 // Value range is [0.0, 1.0]
43 // Value range is [0.0, 1.0]
41− readonly property real progress: Math.min(Math.max(0.0, priv.accumulatedPush / EdgeBarrierSettings.pushThreshold), 1.0)
44+ readonly property real progress: MathUtils.clamp(priv.accumulatedPush / EdgeBarrierSettings.pushThreshold, 0.0, 1.0)
42 onProgressChanged: {
45 onProgressChanged: {
43 print("!!! Progress:", progress)
46 print("!!! Progress:", progress)
@@ -79,32 +82,17 @@ Rectangle {
79 fakeRectangle.transformOrigin = edge;
82 fakeRectangle.transformOrigin = edge;
82− function projectOpacity() {
83− // progress falls into [0,1], opacity moves in [0.2,0.6]
84− fakeRectangle.opacity = MathUtils.clampAndProject(progress, 0.0, 1.0, 0.2, 0.6);
87− function projectScale() {
88− // progress falls into [0,1], scale moves in [1,2] as a hint, when under 10%
89− fakeRectangle.scale = MathUtils.clampAndProject(progress, 0, 1, 1, 2);
92 function processAnimation(amount, animation) {
85 function processAnimation(amount, animation) {
93 priv.push(amount);
86 priv.push(amount);
95− if (progress > 0.1) { // above 10% we start the full preview animation
88+ if (progress > hintThreshold) { // above 10% we start the full preview animation
96− fakeRectangle.scale = 1;
97 animation.start();
89 animation.start();
102− priv.projectOpacity();
106 function commit() {
94 function commit() {
107− if (progress > 0.1 && edge != -1) {
95+ if (progress > hintThreshold && edge != -1) {
108 print("!!! Committing edge", edge, ", progress:", progress);
96 print("!!! Committing edge", edge, ", progress:", progress);
109 target.moveHandler.handlePressedChanged(false, Qt.LeftButton, 0, 0); // cancel the drag
97 target.moveHandler.handlePressedChanged(false, Qt.LeftButton, 0, 0); // cancel the drag
110 if (edge == Item.Top) {
98 if (edge == Item.Top) {
@@ -127,9 +115,8 @@ Rectangle {
128 function stop() {
116 function stop() {
129 print("!!! Stop")
117 print("!!! Stop")
132 priv.accumulatedPush = 0;
118 priv.accumulatedPush = 0;
135 function maximize(amount) {
122 function maximize(amount) {