audio popout peak view brought back, made it prettier

This commit is contained in:
2026-04-03 18:21:50 +02:00
parent 52c947f0ac
commit d77a77071e
2 changed files with 36 additions and 10 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ Shape {
Modules.Background { Modules.Background {
invertBottomRounding: wrapper.x <= 0 invertBottomRounding: wrapper.x <= 0
rounding: root.panels.popouts.currentName.startsWith("updates") ? Appearance.rounding.normal : Appearance.rounding.smallest rounding: root.panels.popouts.currentName.startsWith("updates") || root.panels.popouts.currentName.startsWith("audio") ? Appearance.rounding.normal : Appearance.rounding.smallest
startX: wrapper.x - rounding startX: wrapper.x - rounding
startY: wrapper.y startY: wrapper.y
wrapper: root.panels.popouts wrapper: root.panels.popouts
+35 -9
View File
@@ -11,21 +11,22 @@ import qs.Components
import qs.Daemons import qs.Daemons
import qs.Helpers import qs.Helpers
Item { CustomRect {
id: root id: root
readonly property int rounding: 6 readonly property int rounding: Appearance.rounding.small - Appearance.padding.small
readonly property int topMargin: 0 readonly property int topMargin: 0
required property var wrapper required property var wrapper
implicitHeight: layout.implicitHeight + 5 * 2 color: DynamicColors.tPalette.m3surfaceContainer
implicitWidth: layout.implicitWidth + 5 * 2 implicitHeight: layout.implicitHeight + Appearance.padding.small * 2
implicitWidth: layout.implicitWidth + Appearance.padding.small * 2
radius: Appearance.rounding.small
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.horizontalCenter: parent.horizontalCenter anchors.centerIn: parent
anchors.top: parent.top
implicitWidth: stack.currentItem ? stack.currentItem.childrenRect.height : 0 implicitWidth: stack.currentItem ? stack.currentItem.childrenRect.height : 0
spacing: 12 spacing: 12
@@ -41,7 +42,7 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: tabBar.tabHeight Layout.preferredHeight: tabBar.tabHeight
color: stack.currentIndex === 0 ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer color: stack.currentIndex === 0 ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
radius: 6 radius: root.rounding
StateLayer { StateLayer {
function onClicked(): void { function onClicked(): void {
@@ -60,7 +61,7 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: tabBar.tabHeight Layout.preferredHeight: tabBar.tabHeight
color: stack.currentIndex === 1 ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer color: stack.currentIndex === 1 ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
radius: 6 radius: root.rounding
StateLayer { StateLayer {
function onClicked(): void { function onClicked(): void {
@@ -339,12 +340,15 @@ Item {
Layout.preferredHeight: 1 Layout.preferredHeight: 1
Layout.topMargin: root.topMargin Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3outline color: DynamicColors.tPalette.m3outline
visible: appTracks.model.length > 0
} }
Repeater { Repeater {
id: appTracks
model: Audio.streams.filter(s => s.isSink) model: Audio.streams.filter(s => s.isSink)
CustomRect { CustomClippingRect {
id: appBox id: appBox
required property int index required property int index
@@ -356,6 +360,12 @@ Item {
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: root.rounding radius: root.rounding
PwNodePeakMonitor {
id: peak
node: appBox.modelData
}
RowLayout { RowLayout {
id: layoutVolume id: layoutVolume
@@ -439,6 +449,22 @@ Item {
} }
} }
} }
CustomRect {
id: peakFill
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
color: Qt.alpha(DynamicColors.palette.m3primary, 0.15)
implicitWidth: parent.width * peak.peak
Behavior on implicitWidth {
Anim {
duration: MaterialEasing.expressiveEffectsTime
}
}
}
} }
} }
} }