Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion quickshell/Modules/ControlCenter/Components/DetailHost.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Item {
property string expandedSection: ""
property var expandedWidgetData: null
property var bluetoothCodecSelector: null
property var audioPortSelector: null
property string screenName: ""
property string screenModel: ""

Expand Down Expand Up @@ -212,7 +213,12 @@ Item {

Component {
id: audioOutputDetailComponent
AudioOutputDetail {}
AudioOutputDetail {
onShowPortSelector: node => {
if (root.audioPortSelector)
root.audioPortSelector.show(node);
}
}
}

Component {
Expand Down
2 changes: 2 additions & 0 deletions quickshell/Modules/ControlCenter/Components/DragDropGrid.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Column {
property var model: null
property var expandedWidgetData: null
property var bluetoothCodecSelector: null
property var audioPortSelector: null
property bool darkModeTransitionPending: false
property string screenName: ""
property string screenModel: ""
Expand Down Expand Up @@ -381,6 +382,7 @@ Column {
expandedSection: active ? root.expandedSection : retainedSection
expandedWidgetData: active ? root.expandedWidgetData : retainedWidgetData
bluetoothCodecSelector: root.bluetoothCodecSelector
audioPortSelector: root.audioPortSelector
widgetModel: root.model
collapseCallback: root.collapseRequested
screenName: root.screenName
Expand Down
8 changes: 8 additions & 0 deletions quickshell/Modules/ControlCenter/ControlCenterPopout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ DankPopout {
}
implicitHeight: targetImplicitHeight
property alias bluetoothCodecSelector: bluetoothCodecSelector
property alias audioPortSelector: audioPortSelector

color: "transparent"
clip: true
Expand Down Expand Up @@ -247,6 +248,7 @@ DankPopout {
expandedWidgetData: root.expandedWidgetData
model: widgetModel
bluetoothCodecSelector: bluetoothCodecSelector
audioPortSelector: audioPortSelector
colorPickerModal: root.colorPickerModal
screenName: root.triggerScreen?.name || ""
screenModel: root.triggerScreen?.model || ""
Expand Down Expand Up @@ -298,6 +300,12 @@ DankPopout {
z: 10000
}

AudioPortSelector {
id: audioPortSelector
anchors.fill: parent
z: 10000
}

WidgetConfigOverlay {
id: widgetConfigOverlay
anchors.fill: parent
Expand Down
26 changes: 24 additions & 2 deletions quickshell/Modules/ControlCenter/Details/AudioOutputDetail.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Rectangle {
return widgets.some(widget => widget.id === "volumeSlider");
}

signal showPortSelector(var node)

Component.onCompleted: AudioService.refreshSinkPorts()

implicitHeight: headerRow.height + (!hasVolumeSliderInCC ? volumeSlider.height : 0) + audioContent.height + Theme.spacingM
radius: Theme.cornerRadius
color: Theme.nestedSurface
Expand Down Expand Up @@ -217,6 +221,9 @@ Rectangle {
required property var modelData
required property int index

readonly property bool hasMultiplePorts: AudioService.sinkHasMultiplePorts(modelData)
readonly property real portButtonReserve: hasMultiplePorts ? portButton.width + Theme.spacingXS : 0

width: parent.width
height: 50
radius: Theme.cornerRadius
Expand Down Expand Up @@ -246,7 +253,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: {
const iconWidth = Theme.iconSize;
const pinButtonWidth = pinOutputRow.width + Theme.spacingS * 4 + Theme.spacingM;
const pinButtonWidth = pinOutputRow.width + Theme.spacingS * 4 + Theme.spacingM + outputDelegate.portButtonReserve;
return parent.parent.width - iconWidth - parent.spacing - pinButtonWidth - Theme.spacingM * 2;
}

Expand All @@ -273,7 +280,22 @@ Rectangle {
}
}

DankActionButton {
id: portButton
anchors.right: pinPill.left
anchors.rightMargin: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
visible: outputDelegate.hasMultiplePorts
buttonSize: 28
iconName: "tune"
iconSize: 16
iconColor: Theme.surfaceText
tooltipText: I18n.tr("Port Selection")
onClicked: root.showPortSelector(modelData)
}

Rectangle {
id: pinPill
anchors.right: parent.right
anchors.rightMargin: Theme.spacingM
anchors.verticalCenter: parent.verticalCenter
Expand Down Expand Up @@ -349,7 +371,7 @@ Rectangle {
MouseArea {
id: deviceMouseArea
anchors.fill: parent
anchors.rightMargin: pinOutputRow.width + Theme.spacingS * 4
anchors.rightMargin: pinOutputRow.width + Theme.spacingS * 4 + outputDelegate.portButtonReserve
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onPressed: mouse => {
Expand Down
Loading