mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 07:09:07 +00:00
Refactor: Don't add ScrollManag. inst. to this, since thats not needed
This commit is contained in:
parent
4ba00915e0
commit
0401790fed
@ -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", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user