quickshell: add sheen streaks so art-less discs read as spinning
This commit is contained in:
parent
2b73b1e470
commit
41267747d0
1 changed files with 34 additions and 4 deletions
|
|
@ -4151,7 +4151,11 @@ in
|
|||
|
||||
readonly property real discSize: 86
|
||||
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
|
||||
// its base on the ring and grows
|
||||
|
|
@ -4168,7 +4172,7 @@ in
|
|||
// otherwise every card dances to
|
||||
// whatever else is playing.
|
||||
readonly property real lvl:
|
||||
(mediaCard.modelData.isPlaying
|
||||
(vinyl.spinning
|
||||
&& index < calPopup.levels.length)
|
||||
? calPopup.levels[index] / 100 : 0
|
||||
width: 3
|
||||
|
|
@ -4215,14 +4219,40 @@ in
|
|||
Rectangle {
|
||||
required property int index
|
||||
anchors.centerIn: parent
|
||||
anchors.horizontalCenterOffset: 1
|
||||
anchors.horizontalCenterOffset: 3
|
||||
width: vinyl.discSize - 8 - index * 11
|
||||
height: width
|
||||
radius: width / 2
|
||||
color: "transparent"
|
||||
border.width: 1
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue