mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
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. 
This commit is contained in:
parent
7cf84548c6
commit
600fd05900
1 changed files with 7 additions and 2 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue