mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-05 05:12:05 -04:00
Implement Auto-Bar location aware shadowing
This commit is contained in:
@@ -45,7 +45,8 @@ Rectangle {
|
||||
readonly property real baseShadowBlurPx: (shadowElevation && shadowElevation.blurPx !== undefined) ? shadowElevation.blurPx : 4
|
||||
readonly property real hoverShadowBlurBoost: cardHoverHandler.hovered ? Math.min(2, baseShadowBlurPx * 0.25) : 0
|
||||
property real shadowBlurPx: shadowsAllowed ? (baseShadowBlurPx + hoverShadowBlurBoost) : 0
|
||||
property real shadowOffsetYPx: shadowsAllowed ? (1 + (cardHoverHandler.hovered ? 0.35 : 0)) : 0
|
||||
property real shadowOffsetXPx: shadowsAllowed ? Theme.elevationOffsetX(shadowElevation) : 0
|
||||
property real shadowOffsetYPx: shadowsAllowed ? (Theme.elevationOffsetY(shadowElevation, 1) + (cardHoverHandler.hovered ? 0.35 : 0)) : 0
|
||||
property bool __initialized: false
|
||||
|
||||
Component.onCompleted: {
|
||||
@@ -70,6 +71,13 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on shadowOffsetXPx {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on shadowOffsetYPx {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
@@ -138,7 +146,7 @@ Rectangle {
|
||||
shadowBlur: Math.max(0, Math.min(1, root.shadowBlurPx / Theme.elevationBlurMax))
|
||||
shadowScale: 1
|
||||
shadowVerticalOffset: root.shadowOffsetYPx
|
||||
shadowHorizontalOffset: 0
|
||||
shadowHorizontalOffset: root.shadowOffsetXPx
|
||||
blurMax: Theme.elevationBlurMax
|
||||
shadowColor: root.shadowElevation ? Theme.elevationShadowColor(root.shadowElevation) : "transparent"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user