[gnome-shell/wip/paging-release: 4/43] AppDisplay: Add tweener for change pages



commit 954d3bda007245a920b3c23130eb131bbc046769
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Wed Jun 26 10:40:45 2013 +0200

    AppDisplay: Add tweener for change pages

 js/ui/appDisplay.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index f12627c..a10ad05 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -36,6 +36,10 @@ const FOLDER_SUBICON_FRACTION = .4;
 
 const MAX_APPS_PAGES = 20;
 
+//fraction of page height the finger or mouse must reach before
+//change page
+const PAGE_SWITCH_TRESHOLD = 0.2;
+const PAGE_SWITCH_TIME = 0.25;
 
 // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too
 function _loadCategory(dir, view) {
@@ -361,7 +365,11 @@ const PaginationScrollView = new Lang.Class({
         
         if(pageNumber < this._pages.nPages() && pageNumber >= 0) {
             this._currentPage = pageNumber;
-            this.vscroll.adjustment.set_value(this._pages.getPagePosition(this._currentPage)[1]);
+            let params = { value: this._pages.getPagePosition(this._currentPage)[1],
+                           time: PAGE_SWITCH_TIME,
+                           transition: 'easeOutQuad'
+                          };
+            Tweener.addTween(this.vscroll.adjustment, params);
         }
     },
     


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