[gnome-shell] dash: don't react to window drags
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dash: don't react to window drags
- Date: Tue, 19 Feb 2013 03:50:38 +0000 (UTC)
commit cb7778d43380e3aa55d71cdaa4e825e1785cc55b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Feb 18 22:34:27 2013 -0500
dash: don't react to window drags
Instead, make the actor half-opaque in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=686984
js/ui/dash.js | 9 ---------
js/ui/overviewControls.js | 37 ++++++++++++++++++++++++++++++++++---
2 files changed, 34 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 0d919af..c1385b9 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -24,9 +24,6 @@ const DASH_ITEM_HOVER_TIMEOUT = 300;
function getAppFromSource(source) {
if (source instanceof AppDisplay.AppWellIcon) {
return source.app;
- } else if (source.metaWindow) {
- let tracker = Shell.WindowTracker.get_default();
- return tracker.get_window_app(source.metaWindow);
} else {
return null;
}
@@ -415,12 +412,6 @@ const Dash = new Lang.Class({
Lang.bind(this, this._onDragEnd));
Main.overview.connect('item-drag-cancelled',
Lang.bind(this, this._onDragCancelled));
- Main.overview.connect('window-drag-begin',
- Lang.bind(this, this._onDragBegin));
- Main.overview.connect('window-drag-cancelled',
- Lang.bind(this, this._onDragCancelled));
- Main.overview.connect('window-drag-end',
- Lang.bind(this, this._onDragEnd));
// Translators: this is the name of the dock/favorites area on
// the left of the overview
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index df4d637..42e26a1 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -101,9 +101,10 @@ const SlidingControl = new Lang.Class({
Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
Main.overview.connect('item-drag-end', Lang.bind(this, this._onDragEnd));
Main.overview.connect('item-drag-cancelled', Lang.bind(this, this._onDragEnd));
- Main.overview.connect('window-drag-begin', Lang.bind(this, this._onDragBegin));
- Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onDragEnd));
- Main.overview.connect('window-drag-end', Lang.bind(this, this._onDragEnd));
+
+ Main.overview.connect('window-drag-begin', Lang.bind(this, this._onWindowDragBegin));
+ Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onWindowDragEnd));
+ Main.overview.connect('window-drag-end', Lang.bind(this, this._onWindowDragEnd));
},
getSlide: function() {
@@ -162,6 +163,14 @@ const SlidingControl = new Lang.Class({
this.actor.translation_x = 0;
},
+ _onWindowDragBegin: function() {
+ this._onDragBegin();
+ },
+
+ _onWindowDragEnd: function() {
+ this._onDragEnd();
+ },
+
_onDragBegin: function() {
this.inDrag = true;
this.actor.translation_x = 0;
@@ -173,6 +182,20 @@ const SlidingControl = new Lang.Class({
this.updateSlide();
},
+ fadeIn: function() {
+ Tweener.addTween(this.actor, { opacity: 255,
+ time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeInQuad'
+ });
+ },
+
+ fadeHalf: function() {
+ Tweener.addTween(this.actor, { opacity: 128,
+ time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeOutQuad'
+ });
+ },
+
slideIn: function() {
this.visible = true;
// we will update slideX and the translation from pageEmpty
@@ -294,6 +317,14 @@ const DashSlider = new Lang.Class({
return 1;
else
return 0;
+ },
+
+ _onWindowDragBegin: function() {
+ this.fadeHalf();
+ },
+
+ _onWindowDragEnd: function() {
+ this.fadeIn();
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]