[gnome-shell/gnome-41] appDisplay: Use icon grid size as distance passed to SwipeTracker
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-41] appDisplay: Use icon grid size as distance passed to SwipeTracker
- Date: Fri, 6 May 2022 14:10:00 +0000 (UTC)
commit 15e141d8f1889036d862658b0580fdfde85b8a9e
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sun Apr 10 00:48:39 2022 +0200
appDisplay: Use icon grid size as distance passed to SwipeTracker
The swipeTracker wants the distance between two pages passed to it in
confirmSwipe(). In case of the app grid, the correct distance is not the
size of the scrollView (which has the width of the whole screen), but
instead the allocation size of the iconGrid (which is the actual size
of a page in the grid).
So pass the allocation size of the iconGrid to the swipeTracker, this
makes sure the pages move perfectly in sync with the pointer when
dragging using the mouse or touchscreen.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2275>
(cherry picked from commit 851a1e30fad49ff997c863132de1d7b8bc7470db)
js/ui/appDisplay.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d7dc25ee59..0ff3bee5c7 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -509,7 +509,7 @@ var BaseAppView = GObject.registerClass({
const progress = adjustment.value / adjustment.page_size;
const points = Array.from({ length: this._grid.nPages }, (v, i) => i);
const size = tracker.orientation === Clutter.Orientation.VERTICAL
- ? this._scrollView.height : this._scrollView.width;
+ ? this._grid.allocation.get_height() : this._grid.allocation.get_width();
tracker.confirmSwipe(size, points, progress, Math.round(progress));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]