From 2aa30f5a9677abf4a8209560469bceac07107296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 7 Oct 2022 14:21:08 +0200 Subject: [PATCH] status/volume: Use same icon for slider/top bar Currently the icon in the top bar indicates the volume level, while the icon next to the slider indicates the type of output (speaker or headphone). The speaker- and volume icons are quite similar, but different enough to feel inconsistent, so use the volume one in both cases. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5940 Part-of: --- js/ui/status/volume.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index bd49cc3ae..79950458d 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -204,6 +204,7 @@ const StreamSlider = GObject.registerClass({ let muted = this._stream.is_muted; this._changeSlider(muted ? 0 : this._stream.volume / this._control.get_vol_max_norm()); + this._updateIcon(); this.emit('stream-updated'); } @@ -217,6 +218,10 @@ const StreamSlider = GObject.registerClass({ this._updateVolume(); } + _updateIcon() { + this.iconName = this.getIcon(); + } + getIcon() { if (!this._stream) return null; @@ -308,9 +313,13 @@ class OutputStreamSlider extends StreamSlider { return; this._hasHeadphones = hasHeadphones; + this._updateIcon(); + } + + _updateIcon() { this.iconName = this._hasHeadphones ? 'audio-headphones-symbolic' - : 'audio-speakers-symbolic'; + : this.getIcon(); } });