make config use json instead of shitty qt implementation
This commit is contained in:
parent
4e294cb377
commit
31965a0dba
40 changed files with 272 additions and 745 deletions
93
modules/applets/VolPopup.qml
Normal file
93
modules/applets/VolPopup.qml
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import qs
|
||||
import qs.settings
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.widgets
|
||||
import qs.modules.Services
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
|
||||
PopupWindow {
|
||||
implicitWidth: audioLayout.implicitWidth + 2 * audioLayout.anchors.margins
|
||||
implicitHeight: audioLayout.implicitHeight + 24
|
||||
anchor.edges: Edges.Top | Edges.Right
|
||||
anchor.gravity: Edges.Bottom | Edges.Left
|
||||
anchor.margins.top: 40
|
||||
color: 'transparent'
|
||||
grabFocus: true
|
||||
Rectangle {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
color: Colors.barBg
|
||||
radius: Config.cfg.appearance.rounding
|
||||
ColumnLayout {
|
||||
id: audioLayout
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 10
|
||||
spacing: 8
|
||||
Repeater {
|
||||
id: audioRep
|
||||
model: Audio.sinks
|
||||
|
||||
delegate: Rectangle {
|
||||
Layout.fillWidth: true
|
||||
id: audioDelContainer
|
||||
color: Colors.moduleBg
|
||||
radius: Config.cfg.appearance.rounding
|
||||
required property var modelData
|
||||
implicitHeight: audioRow.implicitHeight + 8
|
||||
implicitWidth: audioRow.implicitWidth
|
||||
|
||||
RowLayout {
|
||||
id: audioRow
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.fill: parent
|
||||
|
||||
StyledText {
|
||||
text: audioDelContainer.modelData.nickname
|
||||
Layout.leftMargin: 10
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: 200
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
StyledIcon {
|
||||
Layout.leftMargin: 10
|
||||
iconName: Audio.getVolumeIcon(audioDelContainer.modelData)
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: {
|
||||
audioDelContainer.modelData.audio.muted = !audioDelContainer.modelData.audio.muted;
|
||||
}
|
||||
}
|
||||
}
|
||||
StyledIcon {
|
||||
iconName: audioDelContainer.modelData === Audio.preferredAudio ? "radio-checked-symbolic" : "radio-symbolic"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: {
|
||||
Audio.setDefaultSink(audioDelContainer.modelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Slider {
|
||||
Layout.rightMargin: 10
|
||||
value: audioDelContainer.modelData.audio.volume
|
||||
from: 0
|
||||
to: 1
|
||||
onMoved: {
|
||||
audioDelContainer.modelData.audio.volume = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue