widgets on pipewire
This commit is contained in:
parent
40742c8b13
commit
fed0d542f7
1 changed files with 5 additions and 17 deletions
|
|
@ -1,16 +1,13 @@
|
||||||
|
import qs.config
|
||||||
|
import qs.widgets
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Services.Pipewire
|
import Quickshell.Services.Pipewire
|
||||||
import "../../../config/"
|
|
||||||
import "../../../styled/"
|
|
||||||
|
|
||||||
Clickable {
|
StyledButton {
|
||||||
id: clickable
|
id: clickable
|
||||||
|
|
||||||
property var sink: Pipewire.defaultAudioSink
|
property var sink: Pipewire.defaultAudioSink
|
||||||
|
|
||||||
implicitWidth: text.width
|
|
||||||
implicitHeight: Dimensions.pipewire.height
|
|
||||||
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
id: bound
|
id: bound
|
||||||
objects: [clickable.sink]
|
objects: [clickable.sink]
|
||||||
|
|
@ -18,7 +15,7 @@ Clickable {
|
||||||
|
|
||||||
onClicked: mouse => {
|
onClicked: mouse => {
|
||||||
if (!sink) {
|
if (!sink) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (mouse.button == Qt.LeftButton) {
|
if (mouse.button == Qt.LeftButton) {
|
||||||
sink.audio.muted = !sink?.audio.muted;
|
sink.audio.muted = !sink?.audio.muted;
|
||||||
|
|
@ -56,20 +53,11 @@ Clickable {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
StyledText {
|
content: StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
property string icon: " "
|
property string icon: " "
|
||||||
|
|
||||||
text: `${icon} ${(clickable.sink?.audio.volume * 100).toFixed()}%`
|
text: `${icon} ${(clickable.sink?.audio.volume * 100).toFixed()}%`
|
||||||
font.pixelSize: Dimensions.pipewire.fontSize
|
font.pixelSize: Dimensions.pipewire.fontSize
|
||||||
|
|
||||||
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
topPadding: Dimensions.pipewire.verticalPadding
|
|
||||||
bottomPadding: Dimensions.pipewire.verticalPadding
|
|
||||||
leftPadding: Dimensions.pipewire.horizontalPadding
|
|
||||||
rightPadding: Dimensions.pipewire.horizontalPadding
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue