Compare commits
1 commit
76d680a95b
...
f8369a340b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8369a340b |
4 changed files with 6 additions and 92 deletions
|
|
@ -11,7 +11,6 @@ Singleton {
|
||||||
property Bar bar: Bar {}
|
property Bar bar: Bar {}
|
||||||
property Mpris mpris: Mpris {}
|
property Mpris mpris: Mpris {}
|
||||||
property Clock clock: Clock {}
|
property Clock clock: Clock {}
|
||||||
property Pipewire pipewire: Pipewire {}
|
|
||||||
property Caffeine caffeine: Caffeine {}
|
property Caffeine caffeine: Caffeine {}
|
||||||
property Workspace workspace: Workspace {}
|
property Workspace workspace: Workspace {}
|
||||||
property Tray tray: Tray {}
|
property Tray tray: Tray {}
|
||||||
|
|
@ -47,19 +46,10 @@ Singleton {
|
||||||
property int verticalPadding: 6
|
property int verticalPadding: 6
|
||||||
}
|
}
|
||||||
|
|
||||||
component Pipewire: QtObject {
|
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int fontSize: 14
|
|
||||||
property int height: 30
|
|
||||||
property int horizontalPadding: 8
|
|
||||||
property int verticalPadding: 6
|
|
||||||
}
|
|
||||||
|
|
||||||
component Caffeine: QtObject {
|
component Caffeine: QtObject {
|
||||||
id: clock
|
id: clock
|
||||||
|
|
||||||
property int fontSize: 16
|
property int iconSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
property int horizontalPadding: 8
|
property int horizontalPadding: 8
|
||||||
property int verticalPadding: 6
|
property int verticalPadding: 6
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,6 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Pipewire {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Caffeine {
|
Caffeine {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,17 @@ Clickable {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
font.family: Theme.lucide.font.family
|
font.family: Theme.lucide.font.family
|
||||||
font.pixelSize: Dimensions.caffeine.fontSize
|
font.pixelSize: Dimensions.workspace.iconSize
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text: Icons.coffee
|
text: Icons.coffee
|
||||||
|
|
||||||
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
topPadding: Dimensions.caffeine.verticalPadding
|
topPadding: Dimensions.mpris.verticalPadding
|
||||||
bottomPadding: Dimensions.caffeine.verticalPadding
|
bottomPadding: Dimensions.mpris.verticalPadding
|
||||||
leftPadding: Dimensions.caffeine.horizontalPadding
|
leftPadding: Dimensions.mpris.horizontalPadding
|
||||||
rightPadding: Dimensions.caffeine.horizontalPadding
|
rightPadding: Dimensions.mpris.horizontalPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
|
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import Quickshell.Services.Pipewire
|
|
||||||
import "../../../config/"
|
|
||||||
import "../../../styled/"
|
|
||||||
|
|
||||||
Clickable {
|
|
||||||
id: clickable
|
|
||||||
|
|
||||||
property var sink: Pipewire.defaultAudioSink
|
|
||||||
|
|
||||||
implicitWidth: text.width
|
|
||||||
implicitHeight: Dimensions.pipewire.height
|
|
||||||
|
|
||||||
PwObjectTracker {
|
|
||||||
id: bound
|
|
||||||
objects: [clickable.sink]
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (mouse.button == Qt.LeftButton) {
|
|
||||||
sink.audio.muted = !sink.audio.muted;
|
|
||||||
} else if (mouse.button == Qt.RightButton) {
|
|
||||||
// show menu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onWheel: event => {
|
|
||||||
if (event.angleDelta.y > 0) {
|
|
||||||
sink.audio.volume = Math.min(sink.audio.volume + 0.02, 1.0);
|
|
||||||
} else if (event.angleDelta.y < 0) {
|
|
||||||
sink.audio.volume -= 0.02;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "muted"
|
|
||||||
when: clickable.sink.audio.muted
|
|
||||||
PropertyChanges {
|
|
||||||
text {
|
|
||||||
icon: " "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "off"
|
|
||||||
when: clickable.sink.audio.volume <= 0
|
|
||||||
PropertyChanges {
|
|
||||||
text {
|
|
||||||
icon: " "
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: text
|
|
||||||
|
|
||||||
property string icon: " "
|
|
||||||
|
|
||||||
text: `${icon} ${(Pipewire.defaultAudioSink.audio.volume * 100).toFixed()}%`
|
|
||||||
font.pixelSize: Dimensions.pipewire.fontSize
|
|
||||||
|
|
||||||
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