audio popout color feedback when muting sink/source, and icons

This commit is contained in:
2026-04-04 16:42:16 +02:00
parent ea7f477665
commit 3f66efc0ac
+31 -7
View File
@@ -214,15 +214,26 @@ CustomRect {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 40 Layout.preferredHeight: 40
Layout.preferredWidth: 40 Layout.preferredWidth: 40
color: DynamicColors.palette.m3primary color: Audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
radius: Appearance.rounding.full radius: Appearance.rounding.full
MaterialIcon { MaterialIcon {
anchors.alignWhenCentered: false anchors.alignWhenCentered: false
anchors.centerIn: parent anchors.centerIn: parent
color: DynamicColors.palette.m3onPrimary animate: true
color: Audio.muted ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onPrimary
font.pointSize: 22 font.pointSize: 22
text: "speaker" text: Audio.muted ? "volume_off" : "volume_up"
}
StateLayer {
color: Audio.muted ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onPrimary
onClicked: {
const audio = Audio.sink?.audio;
if (audio)
audio.muted = !audio.muted;
}
} }
} }
@@ -253,6 +264,7 @@ CustomRect {
CustomSlider { CustomSlider {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
color: Audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 10 implicitHeight: 10
value: Audio.volume value: Audio.volume
@@ -284,19 +296,30 @@ CustomRect {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 15 spacing: 15
Rectangle { CustomRect {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 40 Layout.preferredHeight: 40
Layout.preferredWidth: 40 Layout.preferredWidth: 40
color: DynamicColors.palette.m3primary color: Audio.sourceMuted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
radius: Appearance.rounding.full radius: Appearance.rounding.full
MaterialIcon { MaterialIcon {
anchors.alignWhenCentered: false anchors.alignWhenCentered: false
anchors.centerIn: parent anchors.centerIn: parent
color: DynamicColors.palette.m3onPrimary animate: true
color: Audio.sourceMuted ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onPrimary
font.pointSize: 22 font.pointSize: 22
text: "mic" text: Audio.sourceMuted ? "mic_off" : "mic"
}
StateLayer {
color: Audio.sourceMuted ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onPrimary
onClicked: {
const audio = Audio.source?.audio;
if (audio)
audio.muted = !audio.muted;
}
} }
} }
@@ -328,6 +351,7 @@ CustomRect {
CustomSlider { CustomSlider {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
color: Audio.sourceMuted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 10 implicitHeight: 10
value: Audio.sourceVolume value: Audio.sourceVolume