mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-12 07:19:41 -04:00
feat(DMS FrameMode): A New Connected Unified Surface & Animation Overhaul
- Introduces Standalone & Connected Modes - Updated Animations & Motion effects for both modes - Numerous QOL tweaks and updates throughout the system - Highly inspired to the OG Caelestia Shell / @Soramanew
This commit is contained in:
@@ -141,6 +141,8 @@ Scope {
|
||||
|
||||
WindowBlur {
|
||||
targetWindow: overlayWindow
|
||||
// Track the container's scale so blur shrinks with the content
|
||||
// during exit — otherwise blur pops away one frame after content.
|
||||
readonly property real s: Math.min(1, spotlightContainer.scale)
|
||||
readonly property bool active: overlayWindow.shouldShowSpotlight && spotlightContainer.opacity > 0
|
||||
blurX: spotlightContainer.x + spotlightContainer.width * (1 - s) * 0.5
|
||||
@@ -228,8 +230,26 @@ Scope {
|
||||
|
||||
Item {
|
||||
id: spotlightContainer
|
||||
|
||||
// Connected-frame mode: dock flush against the emerge-side frame
|
||||
// edge and slide in from beyond that edge. In any other mode the
|
||||
// spotlight stays centered — identical to master.
|
||||
readonly property string connectedEmergeSide: SettingsData.frameLauncherEmergeSide || "bottom"
|
||||
readonly property real _centerY: (parent.height - height) / 2
|
||||
readonly property real _connectedRestY: {
|
||||
if (!Theme.isConnectedEffect || !overlayWindow.screen)
|
||||
return _centerY;
|
||||
const inset = SettingsData.frameEdgeInsetForSide(overlayWindow.screen, connectedEmergeSide);
|
||||
return connectedEmergeSide === "top" ? inset : parent.height - height - inset;
|
||||
}
|
||||
readonly property real _connectedCollapsedY: connectedEmergeSide === "top" ? -height : parent.height
|
||||
|
||||
x: Theme.snap((parent.width - width) / 2, overlayWindow.dpr)
|
||||
y: Theme.snap((parent.height - height) / 2, overlayWindow.dpr)
|
||||
y: {
|
||||
if (!Theme.isConnectedEffect)
|
||||
return Theme.snap(_centerY, overlayWindow.dpr);
|
||||
return Theme.snap(overlayWindow.shouldShowSpotlight ? _connectedRestY : _connectedCollapsedY, overlayWindow.dpr);
|
||||
}
|
||||
|
||||
readonly property int baseWidth: {
|
||||
switch (SettingsData.dankLauncherV2Size) {
|
||||
@@ -260,8 +280,8 @@ Scope {
|
||||
|
||||
readonly property bool animatingOut: niriOverviewScope.isClosing && overlayWindow.isSpotlightScreen
|
||||
|
||||
scale: overlayWindow.shouldShowSpotlight ? 1.0 : 0.96
|
||||
opacity: overlayWindow.shouldShowSpotlight ? 1 : 0
|
||||
scale: Theme.isConnectedEffect ? 1.0 : (overlayWindow.shouldShowSpotlight ? 1.0 : 0.96)
|
||||
opacity: Theme.isConnectedEffect ? 1 : (overlayWindow.shouldShowSpotlight ? 1 : 0)
|
||||
visible: overlayWindow.shouldShowSpotlight || animatingOut
|
||||
enabled: overlayWindow.shouldShowSpotlight
|
||||
|
||||
@@ -270,6 +290,22 @@ Scope {
|
||||
layer.textureSize: layer.enabled ? Qt.size(Math.round(width * overlayWindow.dpr), Math.round(height * overlayWindow.dpr)) : Qt.size(0, 0)
|
||||
|
||||
Behavior on scale {
|
||||
id: scaleAnimation
|
||||
enabled: !Theme.isConnectedEffect
|
||||
NumberAnimation {
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: spotlightContainer.visible ? Theme.expressiveCurves.expressiveFastSpatial : Theme.expressiveCurves.standardAccel
|
||||
onRunningChanged: {
|
||||
if (running || !spotlightContainer.animatingOut)
|
||||
return;
|
||||
niriOverviewScope.resetState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
enabled: !Theme.isConnectedEffect
|
||||
NumberAnimation {
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.type: Easing.BezierSpline
|
||||
@@ -277,11 +313,20 @@ Scope {
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
// Connected-mode slide — only animates in full connected-frame mode.
|
||||
// Drives resetState when the slide-out finishes (scale/opacity are
|
||||
// static in connected mode so their onRunningChanged never fires).
|
||||
Behavior on y {
|
||||
enabled: Theme.isConnectedEffect
|
||||
NumberAnimation {
|
||||
duration: Theme.expressiveDurations.fast
|
||||
duration: Theme.variantDuration(Theme.popoutAnimationDuration, overlayWindow.shouldShowSpotlight)
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: spotlightContainer.visible ? Theme.expressiveCurves.expressiveFastSpatial : Theme.expressiveCurves.standardAccel
|
||||
easing.bezierCurve: overlayWindow.shouldShowSpotlight ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||
onRunningChanged: {
|
||||
if (running || !spotlightContainer.animatingOut)
|
||||
return;
|
||||
niriOverviewScope.resetState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user