shift-shell/components/mobileshell/qml/components/MotionStateLayer.qml
Marco Allegretti 6cc92b7fa2 Add SPDX headers to motion QML components
Add missing SPDX copyright and license tags to Motion.qml,
MotionColorAnimation.qml, MotionNumberAnimation.qml, and
MotionStateLayer.qml to satisfy REUSE lint in CI.
2026-05-23 09:18:53 +02:00

50 lines
No EOL
1.3 KiB
QML

// SPDX-FileCopyrightText: 2026 Marco Allegretti
// SPDX-License-Identifier: EUPL-1.2
import QtQuick
import org.kde.kirigami as Kirigami
Item {
id: root
property bool hovered: false
property bool pressed: false
property bool active: false
property bool stateLayerEnabled: true
property color color: Kirigami.Theme.textColor
property color activeColor: Kirigami.Theme.highlightColor
property real hoverOpacity: 0.08
property real pressedOpacity: 0.14
property real activeOpacity: 0.12
property real activeHoverOpacity: 0.18
property real radius: Kirigami.Units.cornerRadius
readonly property real layerOpacity: {
if (!stateLayerEnabled) {
return 0;
}
if (pressed) {
return pressedOpacity;
}
if (active) {
return hovered ? activeHoverOpacity : activeOpacity;
}
return hovered ? hoverOpacity : 0;
}
Rectangle {
anchors.fill: parent
radius: root.radius
color: root.active ? root.activeColor : root.color
opacity: root.layerOpacity
Behavior on color {
MotionColorAnimation { type: Motion.EffectsFast }
}
Behavior on opacity {
MotionNumberAnimation { type: Motion.EffectsFast }
}
}
}