From 6975148163a358f4992c0537c1f217f0aea8fd2d Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sat, 23 Nov 2024 15:24:33 +0100 Subject: [PATCH] make volume bar gray if muted --- resources/style.css | 4 ++++ src/ui/window.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/resources/style.css b/resources/style.css index d492c9f..22e2de1 100644 --- a/resources/style.css +++ b/resources/style.css @@ -44,6 +44,10 @@ toolbarview#main { min-height: 15px; } +.mute #volume-scale trough highlight { + background-color: oklch(from var(--accent-bg-color) l 0% h); +} + #play-queue listview { background-color: rgba(0,0,0,0); } diff --git a/src/ui/window.rs b/src/ui/window.rs index 09b18a7..fef2112 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -477,6 +477,12 @@ mod imp { fn set_mute(&self, mute: bool) { self.mpv.set_property("mute", mute).unwrap(); + + if mute { + self.obj().add_css_class("mute"); + } else { + self.obj().remove_css_class("mute"); + } } fn pause(&self) -> bool {