[gnome-shell/wip/paging-release2: 20/22] appDisplay: Add pan action to FolderView
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/paging-release2: 20/22] appDisplay: Add pan action to FolderView
- Date: Tue, 27 Aug 2013 17:31:25 +0000 (UTC)
commit 0ad4e93450e2bf3fa6cdf0c2829752aeb9bbade7
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 | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 0e5646a..823d1e1 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1012,6 +1012,11 @@ const FolderView = new Lang.Class({
this.actor = new St.ScrollView({ overlay_scrollbars: true });
this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+
+ let action = new Clutter.PanAction({ interpolate: true });
+ action.connect('pan', Lang.bind(this, this._onPan));
+ this.actor.add_action(action);
+
this._box = new St.BoxLayout({ vertical: true, reactive: true });
this._widget = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this._widget.add_child(this._grid.actor);
@@ -1056,6 +1061,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]