From 600fd059008258a5e2753c739e92fade93f67808 Mon Sep 17 00:00:00 2001 From: Micah Stanley Date: Sat, 22 Jun 2024 04:50:09 +0000 Subject: [PATCH] actiondrawer: Added the Over-Scroll Effect to all Portrait Mode Quick Settings States Brought the over-scroll effect found in the pinned quick settings panel to all the portrait mode quick settings states. This helps improve the user experience while also bringing more consistency when pulling down the panel. ![over-scroll](/uploads/a8531b6fb51fde6fc7dc9c9647945899/over-scroll.gif) --- .../qml/actiondrawer/PortraitContentContainer.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index 5d039917..398cf32c 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -72,15 +72,20 @@ Item { addedHeight: { if (!actionDrawer.openToPinnedMode) { // if pinned mode disabled, just go to full height - return quickSettings.maxAddedHeight; + let progress = (root.actionDrawer.offset - maximizedQuickSettingsOffset) / (quickSettings.maxAddedHeight * 4); + let effectProgress = Math.atan(Math.max(0, progress)); + return (quickSettings.maxAddedHeight * effectProgress) + quickSettings.maxAddedHeight; } else if (!actionDrawer.opened) { // over-scroll effect for initial opening let progress = (root.actionDrawer.offset - minimizedQuickSettingsOffset) / quickSettings.maxAddedHeight; let effectProgress = Math.atan(Math.max(0, progress)); return quickSettings.maxAddedHeight * 0.25 * effectProgress; } else { + // over-scroll effect for full drawer + let progress = (root.actionDrawer.offset - maximizedQuickSettingsOffset) / (quickSettings.maxAddedHeight * 4); + let effectProgress = Math.atan(Math.max(0, progress)); // as the drawer opens, add height to the rectangle, revealing content - return Math.max(0, Math.min(quickSettings.maxAddedHeight, root.actionDrawer.offset - minimizedQuickSettingsOffset)); + return (quickSettings.maxAddedHeight * effectProgress) + Math.max(0, Math.min(quickSettings.maxAddedHeight, root.actionDrawer.offset - minimizedQuickSettingsOffset)); } }