From ab10b95d2dc6bda1fc0fcc3b451e535f2fc160a8 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 4 Feb 2023 14:57:20 -0300 Subject: [PATCH] status/network: Bind subtitle Instead of map the currently active items - for whatever they are - into the quick toggle title, bind it to the subtitle. This leaves room for setting static titles for device-backed networks, such as Wi-Fi, Wired, Bluetooth, etc. Part-of: --- js/ui/status/network.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 9c393b34e..7057241a1 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1319,8 +1319,8 @@ const NMToggle = GObject.registerClass({ this._itemBinding.bind('icon-name', this, 'icon-name', GObject.BindingFlags.DEFAULT); this._itemBinding.bind_full('name', - this, 'title', GObject.BindingFlags.DEFAULT, - (bind, source) => [true, this._transformTitle(source)], + this, 'subtitle', GObject.BindingFlags.DEFAULT, + (bind, source) => [true, this._transformSubtitle(source)], null); this.connect('clicked', () => this.activate()); @@ -1360,7 +1360,7 @@ const NMToggle = GObject.registerClass({ // transform function for property binding: // Ignore the provided label if there are multiple active // items, and replace it with something like "VPN (2)" - _transformTitle(source) { + _transformSubtitle(source) { const nActive = this.checked ? [...this._getActiveItems()].length : 0;