1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 21:48:30 -04:00

cava: more optimizations for visualizer

related #2863
This commit is contained in:
bbedward
2026-07-14 14:29:18 -04:00
parent 2c5a1a2804
commit c3fa7b2e1d
2 changed files with 12 additions and 6 deletions
+4 -3
View File
@@ -342,6 +342,7 @@ BasePill {
StyledText {
id: mediaText
readonly property bool onScreen: Window.window?.visible ?? false
property bool needsScrolling: implicitWidth > textContainer.width && SettingsData.scrollTitleEnabled
property real scrollOffset: 0
property real textShift: 0
@@ -351,20 +352,20 @@ BasePill {
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
wrapMode: Text.NoWrap
x: (needsScrolling ? -scrollOffset : 0) + textShift
x: Math.round((needsScrolling ? -scrollOffset : 0) + textShift)
opacity: 1
onTextChanged: {
scrollOffset = 0;
textShift = 0;
scrollAnimation.restart();
textChangeAnimation.restart();
}
SequentialAnimation {
id: scrollAnimation
running: mediaText.needsScrolling && textContainer.visible
running: mediaText.needsScrolling && textContainer.visible && mediaText.onScreen && root._isPlaying
loops: Animation.Infinite
onStopped: mediaText.scrollOffset = 0
PauseAnimation {
duration: 2000