From d6d53ed7bc962024bff5bd6d81f19d2e04671698 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 4 Jun 2026 01:11:04 +1000 Subject: [PATCH] feat: gradient ripple --- components/StateLayer.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/StateLayer.qml b/components/StateLayer.qml index ca177f49..ee9ca9fb 100644 --- a/components/StateLayer.qml +++ b/components/StateLayer.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Shapes +import Caelestia import Caelestia.Config import qs.services @@ -11,7 +12,7 @@ MouseArea { readonly property alias rect: base property bool shapeMorph - property real stateOpacity: pressed ? 0.1 : containsMouse ? 0.08 : 0 + property real stateOpacity: containsMouse ? 0.08 : 0 property real pressX: width / 2 property real pressY: height / 2 @@ -29,7 +30,7 @@ MouseArea { const d2 = distSq(width, 0); const d3 = distSq(0, height); const d4 = distSq(width, height); - return Math.sqrt(Math.max(d1, d2, d3, d4)) + (shapeMorph ? 24 : 0); + return (Math.sqrt(Math.max(d1, d2, d3, d4)) + (shapeMorph ? 24 : 0)) * 1.3; } property real endRadiusAtPress @@ -75,7 +76,7 @@ MouseArea { target: root property: "circleRadius" to: root.endRadius - easing: Tokens.anim.expressiveSlowEffects + easing: Tokens.anim.standard duration: Tokens.anim.durations.expressiveSlowEffects * 2 } @@ -121,12 +122,12 @@ MouseArea { color: Qt.alpha(base.color, 1) } GradientStop { - position: 0.99 + position: CUtils.clamp(1 - 0.2 * root.endRadius / root.circleRadius, 0.01, 0.99) color: Qt.alpha(base.color, 1) } GradientStop { position: 1 - color: Qt.alpha(base.color, 0) + color: Qt.alpha(base.color, CUtils.clamp((root.circleRadius / root.endRadius - 0.9) / 0.1, 0, 1)) } }