mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-17 00:34:01 -04:00
28 lines
504 B
QML
28 lines
504 B
QML
import QtQuick
|
|
import qs.Services
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
property bool active: true
|
|
property bool held: false
|
|
|
|
onActiveChanged: sync()
|
|
Component.onCompleted: sync()
|
|
Component.onDestruction: {
|
|
if (held)
|
|
LyricsService.removeRef();
|
|
}
|
|
|
|
function sync() {
|
|
if (active === held)
|
|
return;
|
|
held = active;
|
|
if (active) {
|
|
LyricsService.addRef();
|
|
return;
|
|
}
|
|
LyricsService.removeRef();
|
|
}
|
|
}
|