File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,27 +45,21 @@ Item {
4545
4646 readonly property bool shouldShow: (currentVisualizerType !== " " && currentVisualizerType !== " none" ) && (! hideWhenIdle || MediaService .isPlaying )
4747
48- readonly property bool needsSpectrum: root .shouldShow && MediaService .isPlaying
49-
5048 // Register/unregister with SpectrumService based on visibility (use screenName — screen can be null after DPMS/output changes)
5149 readonly property string spectrumComponentId: " bar:audiovisualizer:" + screenName + " :" + root .section + " :" + root .sectionWidgetIndex
5250
53- onNeedsSpectrumChanged : {
54- if (root .needsSpectrum ) {
51+ onShouldShowChanged : {
52+ if (root .shouldShow ) {
5553 SpectrumService .registerComponent (root .spectrumComponentId );
5654 } else {
5755 SpectrumService .unregisterComponent (root .spectrumComponentId );
5856 }
5957 }
6058
61- Component .onCompleted : {
62- if (root .needsSpectrum ) {
63- SpectrumService .registerComponent (root .spectrumComponentId );
64- }
65- }
66-
6759 Component .onDestruction : {
68- SpectrumService .unregisterComponent (root .spectrumComponentId );
60+ if (root .shouldShow ) {
61+ SpectrumService .unregisterComponent (root .spectrumComponentId );
62+ }
6963 }
7064
7165 // Content dimensions for implicit sizing
@@ -110,7 +104,7 @@ Item {
110104 id: visualizerLoader
111105 anchors .fill : parent
112106 anchors .margins : Style .marginS
113- active: root . needsSpectrum
107+ active: shouldShow
114108 asynchronous: true
115109
116110 sourceComponent: {
Original file line number Diff line number Diff line change 7575
7676 // SpectrumService registration for visualizer
7777 readonly property string spectrumComponentId: " bar:mediamini:" + root .screen ? .name + " :" + root .section + " :" + root .sectionWidgetIndex
78- readonly property bool needsSpectrum: root .showVisualizer && root .visualizerType !== " " && root .visualizerType !== " none" && ! root .isHidden && MediaService . isPlaying
78+ readonly property bool needsSpectrum: root .showVisualizer && root .visualizerType !== " " && root .visualizerType !== " none" && ! root .isHidden
7979
8080 Layout .preferredHeight : isVertical ? - 1 : Style .getBarHeightForScreen (screenName)
8181 Layout .preferredWidth : isVertical ? Style .getBarHeightForScreen (screenName) : - 1
@@ -265,10 +265,10 @@ Item {
265265 y: Style .pixelAlignCenter (parent .height , height)
266266 width: Style .toOdd (parent .width )
267267 height: Style .toOdd (parent .height )
268- active: root . needsSpectrum
268+ active: showVisualizer
269269 z: 0
270270 sourceComponent: {
271- if (! root . needsSpectrum )
271+ if (! showVisualizer )
272272 return null ;
273273 if (visualizerType === " linear" )
274274 return linearSpectrum;
Original file line number Diff line number Diff line change 1616 readonly property bool hasActivePlayer: MediaService .currentPlayer && MediaService .canPlay
1717
1818 // SpectrumService registration for visualizer
19- readonly property bool needsSpectrum: Settings .data .audio .visualizerType !== " " && Settings .data .audio .visualizerType !== " none" && MediaService . isPlaying
19+ readonly property bool needsSpectrum: Settings .data .audio .visualizerType !== " " && Settings .data .audio .visualizerType !== " none"
2020
2121 onNeedsSpectrumChanged: {
2222 if (root .needsSpectrum ) {
@@ -138,7 +138,7 @@ NBox {
138138 // Background visualizer on top of the artwork
139139 Loader {
140140 anchors .fill : parent
141- active: root . needsSpectrum
141+ active: Settings . data . audio . visualizerType !== " " && Settings . data . audio . visualizerType !== " none "
142142
143143 sourceComponent: {
144144 switch (Settings .data .audio .visualizerType ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ DraggableDesktopWidget {
2525
2626 readonly property bool shouldShow: visualizerType !== " " && visualizerType !== " none" && (! hideWhenIdle || MediaService .isPlaying )
2727 readonly property bool isHidden: ! shouldShow
28- readonly property bool shouldRegisterSpectrum: shouldShow && MediaService . isPlaying
28+ readonly property bool shouldRegisterSpectrum: shouldShow
2929
3030 // Keep widget visible in edit mode so users can move/configure it
3131 visible: ! root .isHidden || DesktopWidgetRegistry .editMode
@@ -66,7 +66,7 @@ DraggableDesktopWidget {
6666 id: visualizerLoader
6767 anchors .fill : parent
6868 anchors .margins : root .showBackground ? Math .round (Style .marginXS * root .widgetScale ) : 0
69- active: root .shouldRegisterSpectrum
69+ active: root .shouldShow
7070 asynchronous: true
7171
7272 sourceComponent: {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ DraggableDesktopWidget {
3434
3535 // SpectrumService registration for visualizer
3636 readonly property string spectrumComponentId: " desktopmediaplayer:" + (root .screen ? root .screen .name : " unknown" )
37- readonly property bool needsSpectrum: root .shouldShowVisualizer && ! root .isHidden && root . isPlaying
37+ readonly property bool needsSpectrum: root .shouldShowVisualizer && ! root .isHidden
3838
3939 onNeedsSpectrumChanged: {
4040 if (root .needsSpectrum ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ Loader {
1717 active: false
1818
1919 // Track if the visualizer should be shown (lockscreen active + media playing + non-compact mode)
20- readonly property bool needsSpectrum: root .active && ! Settings .data .general .compactLockScreen && Settings .data .audio .visualizerType !== " " && Settings .data .audio .visualizerType !== " none" && MediaService . isPlaying
20+ readonly property bool needsSpectrum: root .active && ! Settings .data .general .compactLockScreen && Settings .data .audio .visualizerType !== " " && Settings .data .audio .visualizerType !== " none"
2121
2222 onActiveChanged: {
2323 if (root .active && root .needsSpectrum ) {
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ Item {
264264 Loader {
265265 anchors .fill : parent
266266 anchors .margins : 4
267- active: Settings .data .audio .visualizerType === " linear" && MediaService . isPlaying
267+ active: Settings .data .audio .visualizerType === " linear"
268268 z: 0
269269 sourceComponent: NLinearSpectrum {
270270 anchors .fill : parent
@@ -278,7 +278,7 @@ Item {
278278 Loader {
279279 anchors .fill : parent
280280 anchors .margins : 4
281- active: Settings .data .audio .visualizerType === " mirrored" && MediaService . isPlaying
281+ active: Settings .data .audio .visualizerType === " mirrored"
282282 z: 0
283283 sourceComponent: NMirroredSpectrum {
284284 anchors .fill : parent
@@ -292,7 +292,7 @@ Item {
292292 Loader {
293293 anchors .fill : parent
294294 anchors .margins : 4
295- active: Settings .data .audio .visualizerType === " wave" && MediaService . isPlaying
295+ active: Settings .data .audio .visualizerType === " wave"
296296 z: 0
297297 sourceComponent: NWaveSpectrum {
298298 anchors .fill : parent
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ SmartPanel {
5050
5151 readonly property bool isSideBySide: root .compactMode && root .showAlbumArt
5252
53- readonly property bool needsSpectrum: root .showVisualizer && root .visualizerType !== " " && root .visualizerType !== " none" && root .isPanelOpen && MediaService . isPlaying
53+ readonly property bool needsSpectrum: root .showVisualizer && root .visualizerType !== " " && root .visualizerType !== " none" && root .isPanelOpen
5454
5555 onNeedsSpectrumChanged: {
5656 if (root .needsSpectrum ) {
You can’t perform that action at this time.
0 commit comments