[gnome-shell-extensions/wip/fmuellner/cleanups: 10/13] style: Fix indentation errors



commit 1c360c33477231c949bf0f153d63a0d1c69b94e6
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jan 26 22:05:50 2019 +0100

    style: Fix indentation errors
    
    While we have some style inconsistencies - mostly regarding split lines,
    i.e. aligning to the first arguments vs. a four-space indent - there are
    a couple of places where the spacing is simply wrong. Fix those.
    
    Spotted by eslint.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49

 extensions/apps-menu/extension.js               | 48 ++++++++++++-------------
 extensions/launch-new-instance/extension.js     | 10 +++---
 extensions/native-window-placement/extension.js | 20 +++++------
 extensions/screenshot-window-sizer/extension.js |  4 +--
 extensions/window-list/extension.js             | 16 ++++-----
 extensions/window-list/prefs.js                 |  4 +--
 6 files changed, 50 insertions(+), 52 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index d5369aa..04052d9 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -191,7 +191,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
         // cross-product of AB and AP. See:
         // http://stackoverflow.com/questions/3461453/determine-which-side-of-a-line-a-point-lies
         if (((this.actor.width * y) - (NAVIGATION_REGION_OVERSHOOT * x)) <= 0)
-             return true;
+            return true;
 
         return false;
     }
@@ -531,14 +531,14 @@ class ApplicationsButton extends PanelMenu.Button {
     }
 
     _onOpenStateChanged(menu, open) {
-       if (open) {
-           if (this.reloadFlag) {
-               this._redisplay();
-               this.reloadFlag = false;
-           }
-           this.mainBox.show();
-       }
-       super._onOpenStateChanged(menu, open);
+        if (open) {
+            if (this.reloadFlag) {
+                this._redisplay();
+                this.reloadFlag = false;
+            }
+            this.mainBox.show();
+        }
+        super._onOpenStateChanged(menu, open);
     }
 
     _setKeybinding() {
@@ -707,23 +707,23 @@ class ApplicationsButton extends PanelMenu.Button {
     }
 
     _displayButtons(apps) {
-         if (apps) {
+        if (apps) {
             for (let i = 0; i < apps.length; i++) {
-               let app = apps[i];
-               let item;
-               if (app instanceof Shell.App)
-                   item = this._applicationsButtons.get(app);
-               else
-                   item = new PopupMenu.PopupSeparatorMenuItem();
-               if (!item) {
-                  item = new ApplicationMenuItem(this, app);
-                  item.setDragEnabled(this._desktopTarget.hasDesktop);
-                  this._applicationsButtons.set(app, item);
-               }
-               if (!item.actor.get_parent())
-                  this.applicationsBox.add_actor(item.actor);
+                let app = apps[i];
+                let item;
+                if (app instanceof Shell.App)
+                    item = this._applicationsButtons.get(app);
+                else
+                    item = new PopupMenu.PopupSeparatorMenuItem();
+                if (!item) {
+                    item = new ApplicationMenuItem(this, app);
+                    item.setDragEnabled(this._desktopTarget.hasDesktop);
+                    this._applicationsButtons.set(app, item);
+                }
+                if (!item.actor.get_parent())
+                    this.applicationsBox.add_actor(item.actor);
             }
-         }
+        }
     }
 
     _listApplications(category_menu_id) {
diff --git a/extensions/launch-new-instance/extension.js b/extensions/launch-new-instance/extension.js
index 0cbc49d..1d94067 100644
--- a/extensions/launch-new-instance/extension.js
+++ b/extensions/launch-new-instance/extension.js
@@ -3,12 +3,12 @@ const AppDisplay = imports.ui.appDisplay;
 let _activateOriginal = null;
 
 function enable() {
-  _activateOriginal = AppDisplay.AppIcon.prototype.activate;
-  AppDisplay.AppIcon.prototype.activate = function() {
-      _activateOriginal.call(this, 2);
-  };
+    _activateOriginal = AppDisplay.AppIcon.prototype.activate;
+    AppDisplay.AppIcon.prototype.activate = function() {
+        _activateOriginal.call(this, 2);
+    };
 }
 
 function disable() {
-  AppDisplay.AppIcon.prototype.activate = _activateOriginal;
+    AppDisplay.AppIcon.prototype.activate = _activateOriginal;
 }
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index 7a4ea7d..81cb654 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -24,20 +24,18 @@ class Rect {
 
     union(rect2) {
         let dest = this.copy();
-        if (rect2.x < dest.x)
-          {
+        if (rect2.x < dest.x) {
             dest.width += dest.x - rect2.x;
             dest.x = rect2.x;
-          }
-        if (rect2.y < dest.y)
-          {
+        }
+        if (rect2.y < dest.y) {
             dest.height += dest.y - rect2.y;
             dest.y = rect2.y;
-          }
+        }
         if (rect2.x + rect2.width > dest.x + dest.width)
-          dest.width = rect2.x + rect2.width - dest.x;
+            dest.width = rect2.x + rect2.width - dest.x;
         if (rect2.y + rect2.height > dest.y + dest.height)
-          dest.height = rect2.y + rect2.height - dest.y;
+            dest.height = rect2.y + rect2.height - dest.y;
 
         return dest;
     }
@@ -116,9 +114,9 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
             for (let i = 0; i < rects.length; i++) {
                 for (let j = 0; j < rects.length; j++) {
                     if (i != j && rects[i].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, 
-WINDOW_PLACEMENT_NATURAL_GAPS,
-                                                    WINDOW_PLACEMENT_NATURAL_GAPS, 
WINDOW_PLACEMENT_NATURAL_GAPS).overlap(
-                                                     rects[j].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, 
-WINDOW_PLACEMENT_NATURAL_GAPS,
-                                                                       WINDOW_PLACEMENT_NATURAL_GAPS, 
WINDOW_PLACEMENT_NATURAL_GAPS))) {
+                                                    WINDOW_PLACEMENT_NATURAL_GAPS, 
WINDOW_PLACEMENT_NATURAL_GAPS)
+                                          .overlap(rects[j].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, 
-WINDOW_PLACEMENT_NATURAL_GAPS,
+                                                                     WINDOW_PLACEMENT_NATURAL_GAPS, 
WINDOW_PLACEMENT_NATURAL_GAPS))) {
                         loop_counter++;
                         overlap = true;
 
diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js
index e97d2d9..cee9cfd 100644
--- a/extensions/screenshot-window-sizer/extension.js
+++ b/extensions/screenshot-window-sizer/extension.js
@@ -123,8 +123,8 @@ function cycleScreenshotSizes(display, window, binding) {
 
     let newOuterRect = window.get_frame_rect();
     let message = '%d×%d'.format(
-            (newOuterRect.width / scaleFactor),
-            (newOuterRect.height / scaleFactor));
+        (newOuterRect.width / scaleFactor),
+        (newOuterRect.height / scaleFactor));
 
     // The new size might have been constrained by geometry hints (e.g. for
     // a terminal) - in that case, include the actual ratio to the message
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 9fe9054..e0ae75d 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -30,12 +30,12 @@ const GroupingMode = {
 
 
 function _minimizeOrActivateWindow(window) {
-        let focusWindow = global.display.focus_window;
-        if (focusWindow == window ||
-            focusWindow && focusWindow.get_transient_for() == window)
-            window.minimize();
-        else
-            window.activate(global.get_current_time());
+    let focusWindow = global.display.focus_window;
+    if (focusWindow == window ||
+        focusWindow && focusWindow.get_transient_for() == window)
+        window.minimize();
+    else
+        window.activate(global.get_current_time());
 }
 
 function _openMenu(menu) {
@@ -240,10 +240,10 @@ class BaseButton {
         if (this._perMonitor) {
             this._windowEnteredMonitorId =
                 global.display.connect('window-entered-monitor',
-                    this._windowEnteredOrLeftMonitor.bind(this));
+                                       this._windowEnteredOrLeftMonitor.bind(this));
             this._windowLeftMonitorId =
                 global.display.connect('window-left-monitor',
-                    this._windowEnteredOrLeftMonitor.bind(this));
+                                       this._windowEnteredOrLeftMonitor.bind(this));
         }
     }
 
diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js
index bc1abcd..8cc90f1 100644
--- a/extensions/window-list/prefs.js
+++ b/extensions/window-list/prefs.js
@@ -53,8 +53,8 @@ class WindowListPrefsWidget extends Gtk.Grid {
             let mode = modes[i];
             let label = modeLabels[mode];
             if (!label) {
-               log('Unhandled option "%s" for grouping-mode'.format(mode));
-               continue;
+                log('Unhandled option "%s" for grouping-mode'.format(mode));
+                continue;
             }
 
             radio = new Gtk.RadioButton({ active: currentMode == mode,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]