repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

audio: solid-dark mixer view, drop panel gates

297503863da71ecadacdcfed99bc404b2491fde7

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Changed files (1)

quickshell/nuguland/PopoutHost.qml

Modified
3516 3516 "sources": [],
3517 3517 "streams": [],
3518 3518 "defaults": {
3519 - },
3520 - "audioPanelContract": {
3522 3520 }) : ({
3523 3521 "sinks": [],
3524 3522 "sources": [],
3525 3523 "streams": [],
3526 3524 "defaults": {
3527 - },
3528 - "audioPanelContract": {
3531 3527 readonly property var sinks: state.sinks || []
3532 3528 readonly property var sources: state.sources || []
3533 3529 readonly property var streams: state.streams || []
3534 - readonly property var panel: state.audioPanelContract || ({
3535 - })
3536 - readonly property bool pipewireMixerPanel: !!panel.pipewireMixerPanel
3537 - readonly property bool outputSelector: !!panel.outputSelector
3538 - readonly property bool inputSelector: !!panel.inputSelector
3539 - readonly property bool deviceVolumeSliders: !!panel.deviceVolumeSliders
3540 - readonly property bool perStreamRows: !!panel.perStreamRows
3541 - readonly property bool streamTargetReassignment: !!panel.nativeStreamMove
3542 - readonly property bool noExternalMixer: !!panel.noExternalMixer
3545 3532 function refreshFrom(text) {
3589 3576 spacing: 10
3590 3577 width: parent ? parent.width : 0
3579 + // output devices (sinks). solid-dark cards — the popup frame is light,
3580 + // so a translucent tint fill washes to near-white. Identity is carried
3581 + // by the left accent bar + border; default = ui.accent.
3592 3582 Column {
3593 - objectName: "outputSelector"
3583 + objectName: "outputSection"
3594 3584 width: parent.width
3595 3585 spacing: 6
3607 3597 id: sinkRow
3609 3599 required property var modelData
3610 - readonly property bool active: modelData.id === root.state.defaults.sink
3612 - width: root.width
3613 - implicitHeight: sinkContent.implicitHeight + 12
3614 - radius: 10
3615 - color: root.theme ? root.theme.withAlpha(active ? root.theme.ui.focus : root.theme.ui.minor, active ? 0.28 : 0.12) : "transparent"
3616 - border.width: 0
3617 - border.color: root.theme ? (active ? root.theme.ui.focus : root.theme.ui.accent) : "transparent"
3619 - Column {
3620 - id: sinkContent
3622 - anchors.left: parent.left
3623 - anchors.right: parent.right
3624 - anchors.top: parent.top
3625 - anchors.margins: 6
3626 - spacing: 5
3628 - Row {
3629 - width: parent.width
3630 - spacing: 6
3632 - NuguText {
3633 - theme: root.theme
3634 - text: sinkRow.modelData.name
3635 - width: parent.width - 66
3636 - elide: Text.ElideRight
3639 - NuguText {
3640 - theme: root.theme
3641 - variant: "meta"
3642 - text: sinkRow.modelData.muted ? "muted" : `${Math.round(sinkRow.modelData.volume * 100)}%`
3643 - color: root.roleColor(sinkRow.modelData.muted ? "ui.minor" : "ui.accent")
3648 - Rectangle {
3649 - objectName: "deviceVolumeSliders"
3650 - width: parent.width
3651 - height: 10
3652 - radius: 5
3653 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.28) : "transparent"
3655 - Rectangle {
3656 - anchors.left: parent.left
3657 - anchors.top: parent.top
3658 - anchors.bottom: parent.bottom
3659 - width: Math.round(parent.width * Math.min(1, Math.max(0, sinkRow.modelData.volume)))
3660 - radius: parent.radius
3661 - color: root.roleColor(sinkRow.modelData.muted ? "ui.minor" : "ui.accent")
3664 - MouseArea {
3665 - anchors.fill: parent
3666 - onClicked: (event) => {
3667 - return root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width));
3601 + width: parent.width
3602 + height: 48
3603 + radius: 12
3604 + color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, sinkRow.modelData.isDefault ? 0.82 : 0.55) : "transparent"
3605 + border.width: sinkRow.modelData.isDefault ? 2 : 1
3606 + border.color: root.theme ? (sinkRow.modelData.isDefault ? root.theme.ui.accent : root.theme.withAlpha(root.theme.ui.minor, 0.45)) : "transparent"
3608 + // row click: left selects default sink, middle toggles mute.
3609 + // declared first so the slider-track MouseArea (later sibling,
3610 + // higher z) wins on the track region; glyph/name Text items have
3611 + // no MouseArea so their clicks fall through to here.
3675 3612 MouseArea {
3676 3613 anchors.fill: parent
3677 - acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
3614 + acceptedButtons: Qt.LeftButton | Qt.MiddleButton
3678 3615 onClicked: (event) => {
3679 3616 if (event.button === Qt.MiddleButton)
3680 3617 root.toggleMute(sinkRow.modelData.id);
3681 - else if (event.button === Qt.LeftButton)
3618 + else
3682 3619 root.selectSink(sinkRow.modelData.id);
3623 + // left accent bar — only on the default device
3624 + Rectangle {
3625 + anchors.left: parent.left
3626 + anchors.top: parent.top
3627 + anchors.bottom: parent.bottom
3628 + anchors.margins: 2
3629 + width: 3
3630 + radius: 2
3631 + color: root.theme ? root.theme.ui.accent : "transparent"
3632 + opacity: sinkRow.modelData.isDefault ? 1 : 0
3635 + Text {
3636 + id: sinkGlyph
3638 + anchors.left: parent.left
3639 + anchors.leftMargin: 12
3640 + anchors.verticalCenter: parent.verticalCenter
3641 + font.family: "Symbols Nerd Font Mono"
3642 + font.pixelSize: 18
3643 + text: sinkRow.modelData.glyph
3644 + color: root.roleColor(sinkRow.modelData.role)
3645 + opacity: sinkRow.modelData.muted ? 0.5 : 1
3648 + NuguText {
3649 + theme: root.theme
3650 + text: sinkRow.modelData.name
3651 + anchors.left: sinkGlyph.right
3652 + anchors.leftMargin: 10
3653 + anchors.right: sinkTrack.left
3654 + anchors.rightMargin: 10
3655 + anchors.verticalCenter: parent.verticalCenter
3656 + elide: Text.ElideRight
3657 + opacity: sinkRow.modelData.muted ? 0.5 : 1
3660 + NuguText {
3661 + id: sinkTrailing
3663 + anchors.right: parent.right
3664 + anchors.rightMargin: 12
3665 + anchors.verticalCenter: parent.verticalCenter
3666 + theme: root.theme
3667 + variant: "meta"
3668 + text: sinkRow.modelData.muted ? "muted" : `${sinkRow.modelData.percent}%`
3669 + color: root.roleColor(sinkRow.modelData.muted ? "ui.minor" : sinkRow.modelData.role)
3672 + // inline slider: 0..1.5 volume mapped onto the track (percent/150)
3673 + Rectangle {
3674 + id: sinkTrack
3676 + anchors.right: sinkTrailing.left
3677 + anchors.rightMargin: 10
3678 + anchors.verticalCenter: parent.verticalCenter
3679 + width: 96
3680 + height: 8
3681 + radius: 4
3682 + color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.28) : "transparent"
3684 + Rectangle {
3685 + anchors.left: parent.left
3686 + anchors.top: parent.top
3687 + anchors.bottom: parent.bottom
3688 + width: parent.width * (sinkRow.modelData.percent / 150)
3689 + radius: parent.radius
3690 + color: root.roleColor(sinkRow.modelData.role)
3691 + visible: !sinkRow.modelData.muted
3694 + MouseArea {
3695 + anchors.fill: parent
3696 + onClicked: (event) => {
3697 + return root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width));
3699 + onPositionChanged: (event) => {
3700 + if (pressed)
3701 + root.setVolume(sinkRow.modelData.id, event.x / Math.max(1, width));
3713 + // input devices (sources)
3692 3714 Column {
3693 - objectName: "inputSelector"
3715 + objectName: "inputSection"
3694 3716 width: parent.width
3695 3717 spacing: 6
3707 3729 id: sourceRow
3709 3731 required property var modelData
3710 - readonly property bool active: modelData.id === root.state.defaults.source
3712 - width: root.width
3713 - height: 34
3714 - radius: 10
3715 - color: root.theme ? root.theme.withAlpha(active ? root.theme.ui.focus : root.theme.ui.minor, active ? 0.25 : 0.12) : "transparent"
3716 - border.width: 0
3717 - border.color: root.roleColor(modelData.muted ? "ui.minor" : modelData.active ? "warning" : "ui.accent")
3719 - NuguText {
3720 - anchors.left: parent.left
3721 - anchors.leftMargin: 8
3722 - anchors.verticalCenter: parent.verticalCenter
3723 - theme: root.theme
3724 - text: sourceRow.modelData.name
3725 - width: parent.width - 76
3726 - elide: Text.ElideRight
3729 - NuguText {
3730 - anchors.right: parent.right
3731 - anchors.rightMargin: 8
3732 - anchors.verticalCenter: parent.verticalCenter
3733 - theme: root.theme
3734 - variant: "meta"
3735 - text: sourceRow.modelData.muted ? "muted" : `${Math.round(sourceRow.modelData.volume * 100)}%`
3733 + width: parent.width
3734 + height: 48
3735 + radius: 12
3736 + color: root.theme ? root.theme.withAlpha(root.theme.ui.backdrop, sourceRow.modelData.isDefault ? 0.82 : 0.55) : "transparent"
3737 + border.width: sourceRow.modelData.isDefault ? 2 : 1
3738 + border.color: root.theme ? (sourceRow.modelData.isDefault ? root.theme.ui.accent : root.theme.withAlpha(root.theme.ui.minor, 0.45)) : "transparent"
3738 3740 MouseArea {
3739 3741 anchors.fill: parent
3755 - Column {
3756 - objectName: "perStreamRows"
3757 - width: parent.width
3758 - spacing: 6
3760 - NuguText {
3761 - theme: root.theme
3762 - variant: "title"
3763 - text: "streams"
3766 - Repeater {
3767 - model: root.streams
3769 - delegate: Rectangle {
3770 - id: streamRow
3772 - required property var modelData
3774 - width: root.width
3775 - height: 42
3776 - radius: 10
3777 - color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.1) : "transparent"
3778 - border.width: 0
3779 - border.color: root.theme ? root.theme.ui.accent : "transparent"
3781 - Column {
3751 + Rectangle {
3782 3752 anchors.left: parent.left
3783 - anchors.right: parent.right
3784 - anchors.verticalCenter: parent.verticalCenter
3785 - anchors.leftMargin: 8
3786 - anchors.rightMargin: 8
3787 - spacing: 1
3753 + anchors.top: parent.top
3754 + anchors.bottom: parent.bottom
3755 + anchors.margins: 2
3756 + width: 3
3757 + radius: 2
3758 + color: root.theme ? root.theme.ui.accent : "transparent"
3759 + opacity: sourceRow.modelData.isDefault ? 1 : 0
3789 - NuguText {
3790 - theme: root.theme
3791 - text: `${streamRow.modelData.app}: ${streamRow.modelData.title}`
3792 - width: parent.width
3793 - elide: Text.ElideRight
3762 + Text {
3763 + id: sourceGlyph
3765 + anchors.left: parent.left
3766 + anchors.leftMargin: 12
3767 + anchors.verticalCenter: parent.verticalCenter
3768 + font.family: "Symbols Nerd Font Mono"
3769 + font.pixelSize: 18
3770 + text: sourceRow.modelData.glyph
3771 + color: root.roleColor(sourceRow.modelData.role)
3772 + opacity: sourceRow.modelData.muted ? 0.5 : 1
3775 + NuguText {
3776 + theme: root.theme
3777 + text: sourceRow.modelData.name
3778 + anchors.left: sourceGlyph.right
3779 + anchors.leftMargin: 10
3780 + anchors.right: sourceTrack.left
3781 + anchors.rightMargin: 10
3782 + anchors.verticalCenter: parent.verticalCenter
3783 + elide: Text.ElideRight
3784 + opacity: sourceRow.modelData.muted ? 0.5 : 1
3787 + NuguText {
3788 + id: sourceTrailing
3790 + anchors.right: parent.right
3791 + anchors.rightMargin: 12
3792 + anchors.verticalCenter: parent.verticalCenter
3793 + theme: root.theme
3794 + variant: "meta"
3795 + text: sourceRow.modelData.muted ? "muted" : `${sourceRow.modelData.percent}%`
3796 + color: root.roleColor(sourceRow.modelData.muted ? "ui.minor" : sourceRow.modelData.role)
3799 + Rectangle {
3800 + id: sourceTrack
3802 + anchors.right: sourceTrailing.left
3803 + anchors.rightMargin: 10
3804 + anchors.verticalCenter: parent.verticalCenter
3805 + width: 96
3806 + height: 8
3807 + radius: 4
3808 + color: root.theme ? root.theme.withAlpha(root.theme.ui.minor, 0.28) : "transparent"
3810 + Rectangle {
3811 + anchors.left: parent.left
3812 + anchors.top: parent.top
3813 + anchors.bottom: parent.bottom
3814 + width: parent.width * (sourceRow.modelData.percent / 150)
3815 + radius: parent.radius
3816 + color: root.roleColor(sourceRow.modelData.role)
3817 + visible: !sourceRow.modelData.muted
3796 - NuguText {
3797 - theme: root.theme
3798 - variant: "meta"
3799 - text: `${Math.round(streamRow.modelData.volume * 100)}% → ${streamRow.modelData.target}`
3800 - width: parent.width
3801 - elide: Text.ElideRight
3820 + MouseArea {
3821 + anchors.fill: parent
3822 + onClicked: (event) => {
3823 + return root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width));
3825 + onPositionChanged: (event) => {
3826 + if (pressed)
3827 + root.setVolume(sourceRow.modelData.id, event.x / Math.max(1, width));