[gnome-shell/wip/paging-release2: 21/24] appDisplay: Add pan action to FolderView
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/paging-release2: 21/24] appDisplay: Add pan action to FolderView
- Date: Sat, 31 Aug 2013 01:17:53 +0000 (UTC)
commit 14bd5c9de76bb428f610d5c8a259a15ab9f4a8a3
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Fri Aug 23 20:49:27 2013 +0200
appDisplay: Add pan action to FolderView
Since we have now a ScrollView in the FolderView,
add support for the pan action
https://bugzilla.gnome.org/show_bug.cgi?id=706081
js/ui/appDisplay.js | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ccb0316..d78bd92 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -924,6 +924,10 @@ const FolderView = new Lang.Class({
this._scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true });
this._scrollableContainer.add_actor(this._grid.actor);
this.actor.add_actor(this._scrollableContainer);
+
+ let action = new Clutter.PanAction({ interpolate: true });
+ action.connect('pan', Lang.bind(this, this._onPan));
+ this.actor.add_action(action);
},
_getItemId: function(item) {
@@ -961,6 +965,13 @@ const FolderView = new Lang.Class({
return icon;
},
+ _onPan: function(action) {
+ let [dist, dx, dy] = action.get_motion_delta(0);
+ let adjustment = this.actor.vscroll.adjustment;
+ adjustment.value -= (dy / this.actor.height) * adjustment.page_size;
+ return false;
+ },
+
adaptToSize: function(width, height) {
this._parentAvailableWidth = width;
this._parentAvailableHeight = height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]