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