From c81fe56d7c23b41c7356cdb858173341f5107e11 Mon Sep 17 00:00:00 2001 From: Rosca Alex Date: Thu, 7 Jan 2021 20:06:57 +0100 Subject: [PATCH] effects: Add an animation curve to maximize and fullscreen Replace the default linear easing curve with OutCubic. --- effects/fullscreen/package/contents/code/fullscreen.js | 9 ++++++--- effects/maximize/package/contents/code/maximize.js | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/effects/fullscreen/package/contents/code/fullscreen.js b/effects/fullscreen/package/contents/code/fullscreen.js index 778f0fb12e..e1b6401f15 100644 --- a/effects/fullscreen/package/contents/code/fullscreen.js +++ b/effects/fullscreen/package/contents/code/fullscreen.js @@ -37,7 +37,8 @@ var fullScreenEffect = { from: { value1: oldGeometry.width, value2: oldGeometry.height - } + }, + curve: QEasingCurve.OutCubic }, { type: Effect.Translation, to: { @@ -47,7 +48,8 @@ var fullScreenEffect = { from: { value1: oldGeometry.x - newGeometry.x - (newGeometry.width / 2 - oldGeometry.width / 2), value2: oldGeometry.y - newGeometry.y - (newGeometry.height / 2 - oldGeometry.height / 2) - } + }, + curve: QEasingCurve.OutCubic }] }); if (!window.resize) { @@ -57,7 +59,8 @@ var fullScreenEffect = { animations: [{ type: Effect.CrossFadePrevious, to: 1.0, - from: 0.0 + from: 0.0, + curve: QEasingCurve.OutCubic }] }); } diff --git a/effects/maximize/package/contents/code/maximize.js b/effects/maximize/package/contents/code/maximize.js index 31f6846bdc..931b3bcfef 100644 --- a/effects/maximize/package/contents/code/maximize.js +++ b/effects/maximize/package/contents/code/maximize.js @@ -37,7 +37,8 @@ var maximizeEffect = { from: { value1: oldGeometry.width, value2: oldGeometry.height - } + }, + curve: QEasingCurve.OutCubic }, { type: Effect.Translation, to: { @@ -47,7 +48,8 @@ var maximizeEffect = { from: { value1: oldGeometry.x - newGeometry.x - (newGeometry.width / 2 - oldGeometry.width / 2), value2: oldGeometry.y - newGeometry.y - (newGeometry.height / 2 - oldGeometry.height / 2) - } + }, + curve: QEasingCurve.OutCubic }] }); if (!window.resize) { @@ -57,7 +59,8 @@ var maximizeEffect = { animations: [{ type: Effect.CrossFadePrevious, to: 1.0, - from: 0.0 + from: 0.0, + curve: QEasingCurve.OutCubic }] }); }