[gnome-shell/wip/carlosg/appdisplay-dnd-rtl] appDisplay: Move onto the correct page while DnD on both LTR/RTL




commit 7204d6b50c2d673e1896fb9e806b595417dd5ce8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 1 18:13:02 2021 +0100

    appDisplay: Move onto the correct page while DnD on both LTR/RTL
    
    Look up the next page correctly for the overshoot coordinates, given
    the text direction.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3778

 js/ui/appDisplay.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index dee7df3002..6a1525815a 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -477,11 +477,12 @@ var BaseAppView = GObject.registerClass({
 
         const currentPosition = this._adjustment.value;
         const maxPosition = this._adjustment.upper - this._adjustment.page_size;
+        const rtl = this.get_text_direction() == Clutter.TextDirection.RTL;
 
-        if (dragPosition <= gridStart && currentPosition > 0)
-            this.goToPage(this._grid.currentPage - 1);
-        else if (dragPosition >= gridEnd && currentPosition < maxPosition)
-            this.goToPage(this._grid.currentPage + 1);
+        if (dragPosition <= gridStart)
+            this.goToPage(this._grid.currentPage + (rtl ? 1 : -1));
+        else if (dragPosition >= gridEnd)
+            this.goToPage(this._grid.currentPage + (rtl ? -1 : 1));
         else
             return; // don't go beyond first/last page
 


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