status/volume: Reindent before making code changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>
This commit is contained in:
parent
a768efad06
commit
af5bc30dff
@ -46,12 +46,15 @@ var StreamSlider = class extends Signals.EventEmitter {
|
|||||||
|
|
||||||
this._slider = new Slider.Slider(0);
|
this._slider = new Slider.Slider(0);
|
||||||
|
|
||||||
this._soundSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.sound' });
|
this._soundSettings = new Gio.Settings({
|
||||||
this._soundSettings.connect(`changed::${ALLOW_AMPLIFIED_VOLUME_KEY}`, this._amplifySettingsChanged.bind(this));
|
schema_id: 'org.gnome.desktop.sound',
|
||||||
|
});
|
||||||
|
this._soundSettings.connect(`changed::${ALLOW_AMPLIFIED_VOLUME_KEY}`,
|
||||||
|
() => this._amplifySettingsChanged());
|
||||||
this._amplifySettingsChanged();
|
this._amplifySettingsChanged();
|
||||||
|
|
||||||
this._sliderChangedId = this._slider.connect('notify::value',
|
this._sliderChangedId = this._slider.connect('notify::value',
|
||||||
this._sliderChanged.bind(this));
|
() => this._sliderChanged());
|
||||||
this._slider.connect('drag-begin', () => (this._inDrag = true));
|
this._slider.connect('drag-begin', () => (this._inDrag = true));
|
||||||
this._slider.connect('drag-end', () => {
|
this._slider.connect('drag-end', () => {
|
||||||
this._inDrag = false;
|
this._inDrag = false;
|
||||||
@ -61,15 +64,12 @@ var StreamSlider = class extends Signals.EventEmitter {
|
|||||||
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
|
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
|
||||||
this.item.add(this._icon);
|
this.item.add(this._icon);
|
||||||
this.item.add_child(this._slider);
|
this.item.add_child(this._slider);
|
||||||
this.item.connect('button-press-event', (actor, event) => {
|
this.item.connect('button-press-event',
|
||||||
return this._slider.startDragging(event);
|
(actor, event) => this._slider.startDragging(event));
|
||||||
});
|
this.item.connect('key-press-event',
|
||||||
this.item.connect('key-press-event', (actor, event) => {
|
(actor, event) => this._slider.emit('key-press-event', event));
|
||||||
return this._slider.emit('key-press-event', event);
|
this.item.connect('scroll-event',
|
||||||
});
|
(actor, event) => this._slider.emit('scroll-event', event));
|
||||||
this.item.connect('scroll-event', (actor, event) => {
|
|
||||||
return this._slider.emit('scroll-event', event);
|
|
||||||
});
|
|
||||||
|
|
||||||
this._stream = null;
|
this._stream = null;
|
||||||
this._volumeCancellable = null;
|
this._volumeCancellable = null;
|
||||||
@ -161,8 +161,7 @@ var StreamSlider = class extends Signals.EventEmitter {
|
|||||||
this._volumeCancellable = new Gio.Cancellable();
|
this._volumeCancellable = new Gio.Cancellable();
|
||||||
let player = global.display.get_sound_player();
|
let player = global.display.get_sound_player();
|
||||||
player.play_from_theme('audio-volume-change',
|
player.play_from_theme('audio-volume-change',
|
||||||
_("Volume changed"),
|
_('Volume changed'), this._volumeCancellable);
|
||||||
this._volumeCancellable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_changeSlider(value) {
|
_changeSlider(value) {
|
||||||
@ -297,9 +296,8 @@ var InputStreamSlider = class extends StreamSlider {
|
|||||||
'org.PulseAudio.pavucontrol',
|
'org.PulseAudio.pavucontrol',
|
||||||
];
|
];
|
||||||
|
|
||||||
showInput = this._control.get_source_outputs().some(output => {
|
showInput = this._control.get_source_outputs().some(
|
||||||
return !skippedApps.includes(output.get_application_id());
|
output => !skippedApps.includes(output.get_application_id()));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._showInput = showInput;
|
this._showInput = showInput;
|
||||||
@ -323,18 +321,15 @@ var VolumeMenu = class extends PopupMenu.PopupMenuSection {
|
|||||||
this._control.connect('default-source-changed', this._readInput.bind(this));
|
this._control.connect('default-source-changed', this._readInput.bind(this));
|
||||||
|
|
||||||
this._output = new OutputStreamSlider(this._control);
|
this._output = new OutputStreamSlider(this._control);
|
||||||
this._output.connect('stream-updated', () => {
|
this._output.connect('stream-updated',
|
||||||
this.emit('output-icon-changed');
|
() => this.emit('output-icon-changed'));
|
||||||
});
|
|
||||||
this.addMenuItem(this._output.item);
|
this.addMenuItem(this._output.item);
|
||||||
|
|
||||||
this._input = new InputStreamSlider(this._control);
|
this._input = new InputStreamSlider(this._control);
|
||||||
this._input.item.connect('notify::visible', () => {
|
this._input.item.connect('notify::visible',
|
||||||
this.emit('input-visible-changed');
|
() => this.emit('input-visible-changed'));
|
||||||
});
|
this._input.connect('stream-updated',
|
||||||
this._input.connect('stream-updated', () => {
|
() => this.emit('input-icon-changed'));
|
||||||
this.emit('input-icon-changed');
|
|
||||||
});
|
|
||||||
this.addMenuItem(this._input.item);
|
this.addMenuItem(this._input.item);
|
||||||
|
|
||||||
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
Loading…
Reference in New Issue
Block a user