forked from Shinonome/dots-hyprland
wactioncenter: sound input menu
This commit is contained in:
+7
-1
@@ -9,8 +9,9 @@ import qs.modules.common
|
|||||||
import qs.modules.common.models.quickToggles
|
import qs.modules.common.models.quickToggles
|
||||||
import qs.modules.common.widgets
|
import qs.modules.common.widgets
|
||||||
import qs.modules.waffle.looks
|
import qs.modules.waffle.looks
|
||||||
import qs.modules.waffle.actionCenter.wifi
|
|
||||||
import qs.modules.waffle.actionCenter.bluetooth
|
import qs.modules.waffle.actionCenter.bluetooth
|
||||||
|
import qs.modules.waffle.actionCenter.volumeControl
|
||||||
|
import qs.modules.waffle.actionCenter.wifi
|
||||||
|
|
||||||
DelegateChooser {
|
DelegateChooser {
|
||||||
id: root
|
id: root
|
||||||
@@ -82,6 +83,11 @@ DelegateChooser {
|
|||||||
ActionCenterToggleButton {
|
ActionCenterToggleButton {
|
||||||
toggleModel: MicToggle {}
|
toggleModel: MicToggle {}
|
||||||
icon: WIcons.micIcon
|
icon: WIcons.micIcon
|
||||||
|
menu: Component {
|
||||||
|
VolumeControl {
|
||||||
|
output: false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
|
|||||||
+16
-16
@@ -12,8 +12,7 @@ import qs.modules.waffle.actionCenter
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
implicitWidth: 360
|
property bool output: true
|
||||||
implicitHeight: 352
|
|
||||||
|
|
||||||
PageColumn {
|
PageColumn {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -29,7 +28,7 @@ Item {
|
|||||||
|
|
||||||
HeaderRow {
|
HeaderRow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
title: qsTr("Sound output")
|
title: root.output ? qsTr("Sound output") : qsTr("Sound input")
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledFlickable {
|
StyledFlickable {
|
||||||
@@ -85,45 +84,46 @@ Item {
|
|||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
SectionText {
|
SectionText {
|
||||||
text: qsTr("Output device")
|
text: root.output ? qsTr("Output device") : qsTr("Input device")
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: Audio.outputDevices
|
values: root.output ? Audio.outputDevices : Audio.inputDevices
|
||||||
}
|
}
|
||||||
delegate: WChoiceButton {
|
delegate: WChoiceButton {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
icon.name: WIcons.audioDeviceIcon(modelData)
|
icon.name: WIcons.audioDeviceIcon(modelData)
|
||||||
text: Audio.friendlyDeviceName(modelData)
|
text: Audio.friendlyDeviceName(modelData)
|
||||||
checked: Audio.sink === modelData
|
checked: (root.output ? Audio.sink : Audio.source) === modelData
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Audio.setDefaultSink(modelData);
|
if (root.output) Audio.setDefaultSink(modelData);
|
||||||
|
else Audio.setDefaultSource(modelData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
visible: EasyEffects.available
|
visible: EasyEffects.available && root.output
|
||||||
color: Looks.colors.bg2Hover
|
color: Looks.colors.bg2Hover
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
SectionText {
|
SectionText {
|
||||||
visible: EasyEffects.available
|
visible: EasyEffects.available && root.output
|
||||||
text: qsTr("Sound effects")
|
text: qsTr("Sound effects")
|
||||||
}
|
}
|
||||||
|
|
||||||
WChoiceButton {
|
WChoiceButton {
|
||||||
visible: EasyEffects.available
|
visible: EasyEffects.available && root.output
|
||||||
text: Translation.tr("Off")
|
text: Translation.tr("Off")
|
||||||
checked: !EasyEffects.active
|
checked: !EasyEffects.active
|
||||||
onClicked: EasyEffects.disable()
|
onClicked: EasyEffects.disable()
|
||||||
}
|
}
|
||||||
|
|
||||||
WChoiceButton {
|
WChoiceButton {
|
||||||
visible: EasyEffects.available
|
visible: EasyEffects.available && root.output
|
||||||
text: "EasyEffects"
|
text: "EasyEffects"
|
||||||
checked: EasyEffects.active
|
checked: EasyEffects.active
|
||||||
onClicked: EasyEffects.enable()
|
onClicked: EasyEffects.enable()
|
||||||
@@ -141,14 +141,14 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VolumeEntry {
|
VolumeEntry {
|
||||||
node: Audio.sink
|
node: root.output ? Audio.sink : Audio.source
|
||||||
icon: "speaker"
|
icon: root.output ? "speaker" : "mic-on"
|
||||||
monochrome: true
|
monochrome: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: Audio.outputAppNodes
|
values: root.output ? Audio.outputAppNodes : Audio.inputAppNodes
|
||||||
}
|
}
|
||||||
delegate: VolumeEntry {
|
delegate: VolumeEntry {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ RowLayout {
|
|||||||
right: parent.right
|
right: parent.right
|
||||||
margins: -1
|
margins: -1
|
||||||
}
|
}
|
||||||
implicitSize: 14
|
implicitSize: 16
|
||||||
icon: "speaker-mute"
|
icon: "speaker-mute"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ Button {
|
|||||||
FluentIcon {
|
FluentIcon {
|
||||||
id: buttonIcon
|
id: buttonIcon
|
||||||
monochrome: true
|
monochrome: true
|
||||||
implicitSize: 16
|
implicitSize: 18
|
||||||
Layout.leftMargin: root.iconLeftMargin
|
Layout.leftMargin: root.iconLeftMargin
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|||||||
Reference in New Issue
Block a user