cleanup: Only omit braces for single-line blocks

Braces can be avoided when a block consists of a single statement,
but readability suffers when the statement spans more than a single
line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
Florian Müllner
2019-08-20 02:51:42 +02:00
committed by Georges Basile Stavracas Neto
parent c860409da5
commit 07cc84f632
46 changed files with 178 additions and 101 deletions

View File

@ -101,12 +101,13 @@ class ATIndicator extends PanelMenu.Button {
_buildItemExtended(string, initialValue, writable, onSet) {
let widget = new PopupMenu.PopupSwitchMenuItem(string, initialValue);
if (!writable)
if (!writable) {
widget.reactive = false;
else
} else {
widget.connect('toggled', item => {
onSet(item.state);
});
}
return widget;
}
@ -178,11 +179,12 @@ class ATIndicator extends PanelMenu.Button {
initialSetting,
settings.is_writable(KEY_TEXT_SCALING_FACTOR),
enabled => {
if (enabled)
if (enabled) {
settings.set_double(
KEY_TEXT_SCALING_FACTOR, DPI_FACTOR_LARGE);
else
} else {
settings.reset(KEY_TEXT_SCALING_FACTOR);
}
});
settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => {