quickSettings: Rename 'label' property to 'title'
We'll soon add a subtitle, so rename the label property to something that is a bit more semantic.Add a warning when trying to set the old 'label' property. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2619>
This commit is contained in:
@@ -11,7 +11,7 @@ class RotationToggle extends QuickToggle {
|
||||
this._systemActions = new SystemActions.getDefault();
|
||||
|
||||
super._init({
|
||||
label: _('Auto Rotate'),
|
||||
title: _('Auto Rotate'),
|
||||
});
|
||||
|
||||
this._systemActions.bind_property('can-lock-orientation',
|
||||
|
@@ -148,7 +148,7 @@ const BtClient = GObject.registerClass({
|
||||
const BluetoothToggle = GObject.registerClass(
|
||||
class BluetoothToggle extends QuickToggle {
|
||||
_init(client) {
|
||||
super._init({label: _('Bluetooth')});
|
||||
super._init({title: _('Bluetooth')});
|
||||
|
||||
this._client = client;
|
||||
|
||||
|
@@ -8,7 +8,7 @@ const DarkModeToggle = GObject.registerClass(
|
||||
class DarkModeToggle extends QuickToggle {
|
||||
_init() {
|
||||
super._init({
|
||||
label: _('Dark Style'),
|
||||
title: _('Dark Style'),
|
||||
iconName: 'dark-mode-symbolic',
|
||||
});
|
||||
|
||||
|
@@ -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, 'label', GObject.BindingFlags.DEFAULT,
|
||||
(bind, source) => [true, this._transformLabel(source)],
|
||||
this, 'title', GObject.BindingFlags.DEFAULT,
|
||||
(bind, source) => [true, this._transformTitle(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)"
|
||||
_transformLabel(source) {
|
||||
_transformTitle(source) {
|
||||
const nActive = this.checked
|
||||
? [...this._getActiveItems()].length
|
||||
: 0;
|
||||
|
@@ -17,7 +17,7 @@ const NightLightToggle = GObject.registerClass(
|
||||
class NightLightToggle extends QuickToggle {
|
||||
_init() {
|
||||
super._init({
|
||||
label: _('Night Light'),
|
||||
title: _('Night Light'),
|
||||
iconName: 'night-light-symbolic',
|
||||
toggleMode: true,
|
||||
});
|
||||
|
@@ -17,17 +17,17 @@ const PowerProfilesProxy = Gio.DBusProxy.makeProxyWrapper(PowerProfilesIface);
|
||||
|
||||
const PROFILE_PARAMS = {
|
||||
'performance': {
|
||||
label: C_('Power profile', 'Performance'),
|
||||
title: C_('Power profile', 'Performance'),
|
||||
iconName: 'power-profile-performance-symbolic',
|
||||
},
|
||||
|
||||
'balanced': {
|
||||
label: C_('Power profile', 'Balanced'),
|
||||
title: C_('Power profile', 'Balanced'),
|
||||
iconName: 'power-profile-balanced-symbolic',
|
||||
},
|
||||
|
||||
'power-saver': {
|
||||
label: C_('Power profile', 'Power Saver'),
|
||||
title: C_('Power profile', 'Power Saver'),
|
||||
iconName: 'power-profile-power-saver-symbolic',
|
||||
},
|
||||
};
|
||||
@@ -83,11 +83,11 @@ class PowerProfilesToggle extends QuickMenuToggle {
|
||||
.map(p => p.Profile.unpack())
|
||||
.reverse();
|
||||
for (const profile of profiles) {
|
||||
const {label, iconName} = PROFILE_PARAMS[profile];
|
||||
if (!label)
|
||||
const {title, iconName} = PROFILE_PARAMS[profile];
|
||||
if (!title)
|
||||
continue;
|
||||
|
||||
const item = new PopupMenu.PopupImageMenuItem(label, iconName);
|
||||
const item = new PopupMenu.PopupImageMenuItem(title, iconName);
|
||||
item.connect('activate',
|
||||
() => (this._proxy.ActiveProfile = profile));
|
||||
this._profileItems.set(profile, item);
|
||||
|
@@ -93,7 +93,7 @@ const RfkillToggle = GObject.registerClass(
|
||||
class RfkillToggle extends QuickToggle {
|
||||
_init() {
|
||||
super._init({
|
||||
label: _('Airplane Mode'),
|
||||
title: _('Airplane Mode'),
|
||||
iconName: 'airplane-mode-symbolic',
|
||||
});
|
||||
|
||||
|
@@ -87,7 +87,7 @@ const PowerToggle = GObject.registerClass({
|
||||
});
|
||||
|
||||
this.set({
|
||||
label: _('%d\u2009%%').format(this._proxy.Percentage),
|
||||
title: _('%d\u2009%%').format(this._proxy.Percentage),
|
||||
fallback_icon_name: this._proxy.IconName,
|
||||
gicon,
|
||||
});
|
||||
|
Reference in New Issue
Block a user