[gnome-shell/wip/carlosg/osk-updates] keyboard: Change page switching animation in emoji picker



commit b4b4a976f0d5c0fc7a8b6aff0a6d569610fa6549
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jun 29 20:26:27 2022 +0200

    keyboard: Change page switching animation in emoji picker
    
    Use a carousel animation to switch pages.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5616

 js/ui/keyboard.js | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 3ce5ce0312..f8626e5a8f 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -698,18 +698,13 @@ var EmojiPager = GObject.registerClass({
     }
 
     set delta(value) {
-        if (value > this._width)
-            value = this._width;
-        else if (value < -this._width)
-            value = -this._width;
-
+        value = Math.clamp(value, -this.width, this.width);
         if (this._delta == value)
             return;
 
         this._delta = value;
         this.notify('delta');
 
-        let relValue = Math.abs(value / this._width);
         let followingPage = this.getFollowingPage();
 
         if (this._followingPage != followingPage) {
@@ -720,21 +715,16 @@ var EmojiPager = GObject.registerClass({
 
             if (followingPage != null) {
                 this._followingPanel = this._generatePanel(followingPage);
-                this._followingPanel.set_pivot_point(0.5, 0.5);
                 this.add_child(this._followingPanel);
-                this.set_child_below_sibling(this._followingPanel, this._panel);
             }
 
             this._followingPage = followingPage;
         }
 
         this._panel.translation_x = value;
-        this._panel.opacity = 255 * (1 - Math.pow(relValue, 3));
-
         if (this._followingPanel) {
-            this._followingPanel.scale_x = 0.8 + (0.2 * relValue);
-            this._followingPanel.scale_y = 0.8 + (0.2 * relValue);
-            this._followingPanel.opacity = 255 * relValue;
+            this._followingPanel.translation_x = followingPage > this._curPage
+                ? this._width + value : value - this._width;
         }
     }
 


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