[gnome-shell] overviewControls: fade view selector and thumbnails slider on DnD
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] overviewControls: fade view selector and thumbnails slider on DnD
- Date: Thu, 21 Feb 2013 16:18:08 +0000 (UTC)
commit 1db6d15677221ee05050b32bd2802c8cfad68023
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Feb 17 23:45:24 2013 -0500
overviewControls: fade view selector and thumbnails slider on DnD
When an item is dragged from a page that is not the windows one, the
only possible target is the dash, so fade out the rest.
https://bugzilla.gnome.org/show_bug.cgi?id=686984
js/ui/overviewControls.js | 15 +++++++++++++++
js/ui/viewSelector.js | 16 ++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index ccd6543..e03b572 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -341,6 +341,21 @@ const ControlsManager = new Lang.Class({
this._viewSelector = viewSelector;
this._viewSelector.connect('page-changed', Lang.bind(this, this._setVisibility));
this._viewSelector.connect('page-empty', Lang.bind(this, this._onPageEmpty));
+
+ Main.overview.connect('item-drag-begin', Lang.bind(this,
+ function() {
+ let activePage = this._viewSelector.getActivePage();
+ if (activePage != ViewSelector.ViewPage.WINDOWS)
+ this._viewSelector.fadeHalf();
+ }));
+ Main.overview.connect('item-drag-end', Lang.bind(this,
+ function() {
+ this._viewSelector.fadeIn();
+ }));
+ Main.overview.connect('item-drag-cancelled', Lang.bind(this,
+ function() {
+ this._viewSelector.fadeIn();
+ }));
},
_setVisibility: function() {
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 4e1f1df..386150f 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -502,6 +502,22 @@ const ViewSelector = new Lang.Class({
return ViewPage.APPS;
else
return ViewPage.SEARCH;
+ },
+
+ fadeIn: function() {
+ let actor = this._activePage;
+ Tweener.addTween(actor, { opacity: 255,
+ time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeInQuad'
+ });
+ },
+
+ fadeHalf: function() {
+ let actor = this._activePage;
+ Tweener.addTween(actor, { opacity: 128,
+ time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeOutQuad'
+ });
}
});
Signals.addSignalMethods(ViewSelector.prototype);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]