added adaptive quickshell

This commit is contained in:
wt committed 2026-11-17 18:15:16 +07:00
1 parent 6eb56d2065
commit 5b33a73fd8
189 files changed
+8678 -15

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls.Material
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Services.Pipewire
import "services"
import "components"
ScrollView {
id: page
Material.theme: Theme.dark ? Material.Dark : Material.Light
Material.accent: Theme.primary
clip: true
contentWidth: availableWidth
ColumnLayout {
width: page.availableWidth
spacing: 16
Label { text: "Звук"; font.pixelSize: 24; color: Theme.primary }
Label {
visible: !Hardware.audioReady
text: "Аудиосервис недоступен. Проверьте PipeWire и WirePlumber."
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground
}
Repeater {
model: [{title: "Вывод", nodes: Hardware.outputs, selected: Hardware.sink, sink: true},
{title: "Ввод", nodes: Hardware.inputs, selected: Hardware.source, sink: false}]
ColumnLayout {
id: group
required property var modelData
Layout.fillWidth: true
Label { text: group.modelData.title; font.pixelSize: 20; color: Theme.foreground }
Label { visible: group.modelData.nodes.length === 0; text: "Нет доступных устройств"; color: Theme.outline }
Repeater {
model: group.modelData.nodes
ColumnLayout {
id: device
required property var modelData
Layout.fillWidth: true
ActionButton {
Layout.fillWidth: true
text: (group.modelData.selected === device.modelData ? "✓ " : "") + (device.modelData.description || device.modelData.name)
checked: group.modelData.selected === device.modelData
enabled: device.modelData.ready
onClicked: {
if (group.modelData.sink) Pipewire.preferredDefaultAudioSink = device.modelData;
else Pipewire.preferredDefaultAudioSource = device.modelData;
}
}
RowLayout {
Layout.fillWidth: true
enabled: device.modelData.ready && device.modelData.audio !== null
ActionButton {
text: device.modelData.audio?.muted ? "Включить" : "Заглушить"
onClicked: device.modelData.audio.muted = !device.modelData.audio.muted
}
Slider {
Layout.fillWidth: true
from: 0; to: 1
value: device.modelData.audio?.volume || 0
onMoved: device.modelData.audio.volume = value
Accessible.name: group.modelData.title + ": громкость " + device.modelData.description
}
Label { text: Math.round((device.modelData.audio?.volume || 0) * 100) + "%"; color: Theme.foreground; Layout.preferredWidth: 48 }
}
}
}
}
}
}
}