change id

This commit is contained in:
Benjamin Palko 2025-07-31 09:22:13 -04:00
parent 4047c52ac9
commit 38fce255d8

View file

@ -4,13 +4,13 @@ import QtQuick
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
StyledButton { StyledButton {
id: clickable id: button
property var sink: Pipewire.defaultAudioSink property var sink: Pipewire.defaultAudioSink
PwObjectTracker { PwObjectTracker {
id: bound id: bound
objects: [clickable.sink] objects: [button.sink]
} }
onClicked: mouse => { onClicked: mouse => {
@ -35,7 +35,7 @@ StyledButton {
states: [ states: [
State { State {
name: "muted" name: "muted"
when: clickable.sink?.audio.muted ?? false when: button.sink?.audio.muted ?? false
PropertyChanges { PropertyChanges {
text { text {
icon: " " icon: " "
@ -44,7 +44,7 @@ StyledButton {
}, },
State { State {
name: "off" name: "off"
when: clickable.sink?.audio.volume <= 0 when: button.sink?.audio.volume <= 0
PropertyChanges { PropertyChanges {
text { text {
icon: " " icon: " "
@ -56,8 +56,8 @@ StyledButton {
content: StyledText { content: StyledText {
id: text id: text
property string icon: " " property string icon: " "
text: `${icon} ${(clickable.sink?.audio.volume * 100).toFixed()}%` text: `${icon} ${(button.sink?.audio.volume * 100).toFixed()}%`
font.pixelSize: Dimensions.pipewire.fontSize font.pixelSize: Dimensions.pipewire.fontSize
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent color: button.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
} }
} }