From fddeb43b7c504996d98bb3638ad304f794b674e2 Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Sun, 27 Sep 2015 12:17:24 +0200 Subject: [PATCH] Change animation if vertical position is below 50%, fixes issue #12 . --- src/extension.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/extension.js b/src/extension.js index 2ec91c9..f27ce9d 100644 --- a/src/extension.js +++ b/src/extension.js @@ -204,12 +204,10 @@ let extensionShowNotification = function() { this._bannerBin._opacity = 0; this._bannerBin.opacity = 0; - let yTop = (Main.layoutManager.bottomMonitor.y + Main.layoutManager.bottomMonitor.height); - - let yBottom = this._banner.actor.height; - - this._bannerBin.y = -(yTop - yBottom) * getY_position() / 100 + yBottom; - this._bannerBin.y = -this._banner.actor.height; + if (getY_position() < 50) + this._bannerBin.y = Main.layoutManager.bottomMonitor.y + Main.layoutManager.bottomMonitor.height; + else + this._bannerBin.y = -this._banner.actor.height; this.actor.show(); } else @@ -224,10 +222,10 @@ let extensionShowNotification = function() { this._notificationWidget.opacity = 0; // JRL changes begin //this._notificationWidget.y = 0; - let yTop = -(Main.layoutManager.bottomMonitor.y + Main.layoutManager.bottomMonitor.height); - let yBottom = 0; - - this._notificationWidget.y = (yTop - yBottom) * getY_position() / 100 + yBottom; + if (getY_position() < 50) + this._notificationWidget.y = this.actor.height; + else + this._notificationWidget.y = -(Main.layoutManager.bottomMonitor.y + Main.layoutManager.bottomMonitor.height); // JRL changes end