use svg icons instead of goofy font
This commit is contained in:
parent
d3b5ccc48b
commit
5df124dc5f
6 changed files with 83 additions and 37 deletions
|
|
@ -1,6 +1,9 @@
|
|||
//@ pragma IconTheme Adwaita
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Effects
|
||||
|
|
@ -18,17 +21,18 @@ BarComponent {
|
|||
function getVolumeIcon() {
|
||||
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
|
||||
if (root.mute) {
|
||||
return "\ue04f";
|
||||
return "audio-volume-muted";
|
||||
}
|
||||
if (volume <= 0.33) {
|
||||
return "\ue04e";
|
||||
return "audio-volume-low";
|
||||
}
|
||||
if (volume <= 0.66) {
|
||||
return "\ue04d";
|
||||
return "audio-volume-medium";
|
||||
}
|
||||
if (volume >= 0.66) {
|
||||
return "\ue050";
|
||||
return "audio-volume-high";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
|
|
@ -45,10 +49,16 @@ BarComponent {
|
|||
id: pwLayout
|
||||
anchors.centerIn: root
|
||||
spacing: 4
|
||||
MaterialIcon {
|
||||
text: root.getVolumeIcon()
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
}
|
||||
IconImage {
|
||||
source: Quickshell.iconPath(root.getVolumeIcon() + "-symbolic", root.getVolumeIcon())
|
||||
implicitSize: 14
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
colorization: 1.0
|
||||
colorizationColor: Colors.text
|
||||
brightness: 0.5
|
||||
}
|
||||
}
|
||||
StyledText {
|
||||
text: Math.round(root.defaultAudio?.audio.volume * 100) + "%"
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue