[gnome-shell/T27795: 107/138] appDisplay: Enable or disable panning depending on the number of pages
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 107/138] appDisplay: Enable or disable panning depending on the number of pages
- Date: Tue, 1 Oct 2019 23:38:19 +0000 (UTC)
commit 1c2576cf35427b6fecc8d47e92cb2a0998d27024
Author: Mario Sanchez Prada <mario endlessm com>
Date: Fri Jun 16 23:57:02 2017 +0100
appDisplay: Enable or disable panning depending on the number of pages
We don't want to allow the user to move the icon grid up/down when
there's no other page to move to, so disable/enable this feature
depending on the number of pages.
https://phabricator.endlessm.com/T17658
js/ui/appDisplay.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 277ccaf649..70076bf43d 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -374,8 +374,8 @@ var AllView = class AllView extends BaseAppView {
panAction.connect('gesture-cancel', this._onPanEnd.bind(this));
panAction.connect('gesture-end', this._onPanEnd.bind(this));
this._panAction = panAction;
- this._scrollView.add_action(panAction);
this._panning = false;
+
this._clickAction = new Clutter.ClickAction();
this._clickAction.connect('clicked', () => {
if (!this._currentPopup)
@@ -762,6 +762,11 @@ var AllView = class AllView extends BaseAppView {
// Update folder views
for (let i = 0; i < this.folderIcons.length; i++)
this.folderIcons[i].adaptToSize(availWidth, availHeight);
+
+ // Enable panning depending on the number of pages
+ this._scrollView.remove_action(this._panAction);
+ if (this._grid.nPages() > 1)
+ this._scrollView.add_action(this._panAction);
}
_handleDragOvershoot(dragEvent) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]