mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 08:57:21 +00:00
Add missing SPDX copyright and license tags to Motion.qml, MotionColorAnimation.qml, MotionNumberAnimation.qml, and MotionStateLayer.qml to satisfy REUSE lint in CI.
50 lines
No EOL
1.3 KiB
QML
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 }
|
|
}
|
|
}
|
|
} |