From 0401790fed0d20d77b3d238e9e51eec54797b098 Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Sat, 28 Jan 2023 22:46:10 +0100 Subject: [PATCH] Refactor: Don't add ScrollManag. inst. to `this`, since thats not needed --- src/prefsModules/PrefsPage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/prefsModules/PrefsPage.js b/src/prefsModules/PrefsPage.js index 2fae743..abd6791 100644 --- a/src/prefsModules/PrefsPage.js +++ b/src/prefsModules/PrefsPage.js @@ -34,7 +34,7 @@ var PrefsPage = GObject.registerClass({ // Pass `this.get_first_child()` to the ScrollManager, since this // `PrefsPage` extends an `Adw.PreferencesPage` and the first child of // an `Adw.PreferencesPage` is the built-in `Gtk.ScrolledWindow`. - this._scrollManager = new ScrollManager.ScrollManager(this.get_first_child()); + const scrollManager = new ScrollManager.ScrollManager(this.get_first_child()); /// Setup GtkDropControllerMotion event controller and make use of its /// events. @@ -44,18 +44,18 @@ var PrefsPage = GObject.registerClass({ controller.connect("motion", (_, _x, y) => { // If the pointer is currently in the upper ten percent of this // widget, then scroll up. - if (y <= this.get_allocated_height() * 0.1) this._scrollManager.startScrollUp(); + if (y <= this.get_allocated_height() * 0.1) scrollManager.startScrollUp(); // If the pointer is currently in the lower ten percent of this // widget, then scroll down. - else if (y >= this.get_allocated_height() * 0.9) this._scrollManager.startScrollDown(); + else if (y >= this.get_allocated_height() * 0.9) scrollManager.startScrollDown(); // Otherwise stop scrolling. - else this._scrollManager.stopScrollAll(); + else scrollManager.stopScrollAll(); }); // Make sure scrolling stops, when DND operation ends. this._dndEnded = true; const stopScrollAllAtDNDEnd = () => { - this._scrollManager.stopScrollAll(); + scrollManager.stopScrollAll(); this._dndEnded = true; }; controller.connect("leave", () => {