[gnome-shell/wip/grab-helper-top-panel: 14/20] workspacesView: Clean up scroll code a bit
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/grab-helper-top-panel: 14/20] workspacesView: Clean up scroll code a bit
- Date: Mon, 26 Nov 2012 21:40:34 +0000 (UTC)
commit ae22bde368de53d324587197eab76c132d4f8583
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Nov 25 23:54:11 2012 -0500
workspacesView: Clean up scroll code a bit
There's no code path that results in us not animating.
https://bugzilla.gnome.org/show_bug.cgi?id=689062
js/ui/workspacesView.js | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index e99fe3d..b9fdd1e 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -205,11 +205,11 @@ const WorkspacesView = new Lang.Class({
this._workspaces[w].positionWindows(Workspace.WindowPositionFlags.ANIMATE);
},
- _scrollToActive: function(showAnimation) {
+ _scrollToActive: function() {
let active = global.screen.get_active_workspace_index();
- this._updateWorkspaceActors(showAnimation);
- this._updateScrollAdjustment(active, showAnimation);
+ this._updateWorkspaceActors(true);
+ this._updateScrollAdjustment(active);
},
// Update workspace actors parameters
@@ -267,26 +267,21 @@ const WorkspacesView = new Lang.Class({
}
},
- _updateScrollAdjustment: function(index, showAnimation) {
+ _updateScrollAdjustment: function(index) {
if (this._scrolling)
return;
this._animatingScroll = true;
- if (showAnimation) {
- Tweener.addTween(this.scrollAdjustment, {
- value: index,
- time: WORKSPACE_SWITCH_TIME,
- transition: 'easeOutQuad',
- onComplete: Lang.bind(this,
- function() {
- this._animatingScroll = false;
- })
- });
- } else {
- this.scrollAdjustment.value = index;
- this._animatingScroll = false;
- }
+ Tweener.addTween(this.scrollAdjustment, {
+ value: index,
+ time: WORKSPACE_SWITCH_TIME,
+ transition: 'easeOutQuad',
+ onComplete: Lang.bind(this,
+ function() {
+ this._animatingScroll = false;
+ })
+ });
},
updateWorkspaces: function(oldNumWorkspaces, newNumWorkspaces) {
@@ -313,7 +308,7 @@ const WorkspacesView = new Lang.Class({
if (this._scrolling)
return;
- this._scrollToActive(true);
+ this._scrollToActive();
},
_onDestroy: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]