Compare commits
2 Commits
2147220cd7
...
52a52b7aa2
| Author | SHA1 | Date | |
|---|---|---|---|
| 52a52b7aa2 | |||
| 9ffcfa08cb |
@ -1,4 +1,5 @@
|
|||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import QtQuick.Layouts
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Services.Pipewire
|
import Quickshell.Services.Pipewire
|
||||||
import qs.settings
|
import qs.settings
|
||||||
@ -6,17 +7,12 @@ import qs.reusables
|
|||||||
import qs
|
import qs
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: container
|
id: root
|
||||||
radius: implicitHeight / 2
|
radius: implicitHeight / 2
|
||||||
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
color: pavuArea.containsMouse ? Colors.primaryContainer : Colors.surfaceContainer
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
implicitWidth: root.implicitWidth + 20
|
implicitWidth: textRow.implicitWidth + 20
|
||||||
implicitHeight: Settings.config.barHeight - 10
|
implicitHeight: Settings.config.barHeight - 8
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
anchors.centerIn: parent
|
|
||||||
implicitWidth: textRow.width
|
|
||||||
implicitHeight: Settings.config.barHeight
|
|
||||||
property var sink: Pipewire.defaultAudioSink
|
property var sink: Pipewire.defaultAudioSink
|
||||||
function getVolumeIcon() {
|
function getVolumeIcon() {
|
||||||
// Safety check: if Pipewire is dead or sink is missing
|
// Safety check: if Pipewire is dead or sink is missing
|
||||||
@ -40,13 +36,13 @@ Rectangle {
|
|||||||
// If it's loud, prepare the ears!
|
// If it's loud, prepare the ears!
|
||||||
return "volume_up";
|
return "volume_up";
|
||||||
}
|
}
|
||||||
Row {
|
RowLayout {
|
||||||
id: textRow
|
id: textRow
|
||||||
anchors.centerIn: root
|
spacing: 2
|
||||||
spacing: 5
|
anchors.centerIn: parent
|
||||||
CustomText {
|
CustomText {
|
||||||
id: volumeText
|
id: volumeText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
||||||
}
|
}
|
||||||
@ -55,7 +51,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
id: volumeIcon
|
id: volumeIcon
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0
|
opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0
|
||||||
text: Pipewire.ready ? root.getVolumeIcon() : null
|
text: Pipewire.ready ? root.getVolumeIcon() : null
|
||||||
}
|
}
|
||||||
@ -73,4 +69,3 @@ Rectangle {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -3,9 +3,11 @@ import qs.settings
|
|||||||
import qs
|
import qs
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
property bool fill: true
|
property bool fill: true
|
||||||
font.family: fill ? "Material Symbols Rounded Filled" : "Material Symbols Rounded"
|
font.family: fill ? "Material Symbols Rounded Filled" : "Material Symbols Rounded"
|
||||||
color: Colors.onSurfaceColor
|
color: Colors.onSurfaceColor
|
||||||
|
font.pixelSize: Settings.config.fontSize + 2
|
||||||
font.variableAxes: ({
|
font.variableAxes: ({
|
||||||
GRAD: 100,
|
GRAD: 100,
|
||||||
opsz: fill ? 48 : 20,
|
opsz: fill ? 48 : 20,
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import qs
|
|||||||
import qs.settings
|
import qs.settings
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: Colors.onSurfaceColor
|
color: Colors.onSurfaceColor
|
||||||
font.family: Settings.config.font
|
font.family: Settings.config.font
|
||||||
font.pixelSize: Settings.config.fontSize
|
font.pixelSize: Settings.config.fontSize
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user