quickshell: add sheen streaks so art-less discs read as spinning

This commit is contained in:
rope 2026-07-30 16:04:29 +01:00
parent 2b73b1e470
commit 41267747d0

View file

@ -4151,7 +4151,11 @@ in
readonly property real discSize: 86 readonly property real discSize: 86
readonly property real ringR: 47 readonly property real ringR: 47
readonly property bool spinning: mediaCard.modelData.isPlaying // Same expression the play/pause button
// uses, so the disc can never disagree
// with the glyph next to it.
readonly property bool spinning:
mediaCard.modelData.playbackState === MprisPlaybackState.Playing
// Spectrum ring. Each bar sits with // Spectrum ring. Each bar sits with
// its base on the ring and grows // its base on the ring and grows
@ -4168,7 +4172,7 @@ in
// otherwise every card dances to // otherwise every card dances to
// whatever else is playing. // whatever else is playing.
readonly property real lvl: readonly property real lvl:
(mediaCard.modelData.isPlaying (vinyl.spinning
&& index < calPopup.levels.length) && index < calPopup.levels.length)
? calPopup.levels[index] / 100 : 0 ? calPopup.levels[index] / 100 : 0
width: 3 width: 3
@ -4215,14 +4219,40 @@ in
Rectangle { Rectangle {
required property int index required property int index
anchors.centerIn: parent anchors.centerIn: parent
anchors.horizontalCenterOffset: 1 anchors.horizontalCenterOffset: 3
width: vinyl.discSize - 8 - index * 11 width: vinyl.discSize - 8 - index * 11
height: width height: width
radius: width / 2 radius: width / 2
color: "transparent" color: "transparent"
border.width: 1 border.width: 1
border.color: Theme.base03 border.color: Theme.base03
opacity: 0.18 opacity: 0.22
}
}
// Two opposed sheen streaks, like
// light catching the vinyl. Without
// these an art-less disc looks
// stationary: faint near-concentric
// grooves give the eye nothing to
// track, so the spin reads as a bug.
Repeater {
model: 2
Rectangle {
id: sheen
required property int index
width: 2
radius: 1
height: vinyl.discSize * 0.4
color: Theme.base04
opacity: 0.3
x: blankLabel.width / 2 - width / 2
y: blankLabel.height / 2 - height
transform: Rotation {
origin.x: sheen.width / 2
origin.y: sheen.height
angle: sheen.index * 180
}
} }
} }
} }