Compare commits

..

No commits in common. "52a52b7aa282bd780ab2273eeaca63001a1c3747" and "2147220cd705f55940d5f6d5c611d42480b10a80" have entirely different histories.

3 changed files with 58 additions and 56 deletions

View File

@ -1,5 +1,4 @@
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
@ -7,12 +6,17 @@ import qs.reusables
import qs import qs
Rectangle { Rectangle {
id: root id: container
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: textRow.implicitWidth + 20 implicitWidth: root.implicitWidth + 20
implicitHeight: Settings.config.barHeight - 8 implicitHeight: Settings.config.barHeight - 10
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
@ -36,13 +40,13 @@ Rectangle {
// If it's loud, prepare the ears! // If it's loud, prepare the ears!
return "volume_up"; return "volume_up";
} }
RowLayout { Row {
id: textRow id: textRow
spacing: 2 anchors.centerIn: root
anchors.centerIn: parent spacing: 5
CustomText { CustomText {
id: volumeText id: volumeText
anchors.verticalCenter: parent.verticalCenter
PwObjectTracker { PwObjectTracker {
objects: Pipewire.ready ? Pipewire.defaultAudioSink : [] objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
} }
@ -51,7 +55,7 @@ Rectangle {
} }
CustomIcon { CustomIcon {
id: volumeIcon id: volumeIcon
Layout.alignment: Qt.AlignVCenter anchors.verticalCenter: parent.verticalCenter
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
} }
@ -68,4 +72,5 @@ Rectangle {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true
} }
}
} }

View File

@ -3,11 +3,9 @@ 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,

View File

@ -3,7 +3,6 @@ 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