[gnome-shell/wip/fmuellner/notification-redux+sass: 44/61] Misc. message tray stuff
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/notification-redux+sass: 44/61] Misc. message tray stuff
- Date: Thu, 19 Feb 2015 14:12:20 +0000 (UTC)
commit 9d18ee632f8c8ba3989617521063d3571faa1bc6
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 19 11:02:44 2015 +0100
Misc. message tray stuff
This reverts commit 975a6c6a724183eff5622baa20ab1ad5083006ef.
mt experiment
Revert "mt experiment"
This reverts commit c6424514823adb705ee1568933d90695b7df1b43.
js/ui/messageTray.js | 84 ++++++++++++++++---------------------------------
1 files changed, 28 insertions(+), 56 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index ff29b8d..2b13c63 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1452,20 +1452,16 @@ const MessageTray = new Lang.Class({
}));
this.actor = new St.Widget({ name: 'notification-container',
- reactive: true,
- track_hover: true,
- y_align: Clutter.ActorAlign.START,
- x_align: Clutter.ActorAlign.CENTER,
- y_expand: true,
- x_expand: true,
+ clip_to_allocation: true,
+ x_expand: true, y_expand: true,
layout_manager: new Clutter.BinLayout() });
this.actor.connect('key-release-event', Lang.bind(this, this._onNotificationKeyRelease));
- this.actor.connect('notify::hover', Lang.bind(this, this._onNotificationHoverChanged));
- this._notificationBin = new St.Bin({ y_expand: true });
+ this._notificationBin = new St.Bin({ reactive: true, track_hover: true, x_expand: true, y_expand:
true });
+ this._notificationBin.connect('notify::hover', Lang.bind(this, this._onNotificationHoverChanged));
+ this._notificationBin.set_x_align(Clutter.ActorAlign.CENTER);
this._notificationBin.set_y_align(Clutter.ActorAlign.START);
this.actor.add_actor(this._notificationBin);
- this.actor.hide();
this._notificationFocusGrabber = new FocusGrabber(this.actor);
this._notificationQueue = [];
this._notification = null;
@@ -1497,6 +1493,7 @@ const MessageTray = new Lang.Class({
Main.layoutManager.trayBox.add_actor(this.actor);
Main.layoutManager.trackChrome(this.actor);
+ Main.layoutManager.trackChrome(this._notificationBin);
global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._updateState));
@@ -1650,10 +1647,10 @@ const MessageTray = new Lang.Class({
},
_onNotificationHoverChanged: function() {
- if (this.actor.hover == this._notificationHovered)
+ if (this._notificationBin.hover == this._notificationHovered)
return;
- this._notificationHovered = this.actor.hover;
+ this._notificationHovered = this._notificationBin.hover;
if (this._notificationHovered) {
this._resetNotificationLeftTimeout();
@@ -1710,11 +1707,11 @@ const MessageTray = new Lang.Class({
_onNotificationLeftTimeout: function() {
let [x, y, mods] = global.get_pointer();
- // We extend the timeout once if the mouse moved no further than MOUSE_LEFT_ACTOR_THRESHOLD to
either side or up.
+ // We extend the timeout once if the mouse moved no further than MOUSE_LEFT_ACTOR_THRESHOLD to
either side or down.
// We don't check how far down the mouse moved because any point above the tray, but below the exit
coordinate,
// is close to the tray.
if (this._notificationLeftMouseX > -1 &&
- y > this._notificationLeftMouseY - MOUSE_LEFT_ACTOR_THRESHOLD &&
+ y < this._notificationLeftMouseY + MOUSE_LEFT_ACTOR_THRESHOLD &&
x < this._notificationLeftMouseX + MOUSE_LEFT_ACTOR_THRESHOLD &&
x > this._notificationLeftMouseX - MOUSE_LEFT_ACTOR_THRESHOLD) {
this._notificationLeftMouseX = -1;
@@ -1837,9 +1834,7 @@ const MessageTray = new Lang.Class({
}));
this._notificationBin.child = this._notification.actor;
- this.actor.opacity = 0;
- this.actor.y = 0;
- this.actor.show();
+ this._notificationBin.y = -this._notification.actor.height;
this._updateShowingNotification();
@@ -1881,15 +1876,19 @@ const MessageTray = new Lang.Class({
// We use this._showNotificationCompleted() onComplete callback to extend the time the updated
// notification is being shown.
- let tweenParams = { opacity: 255,
- y: -this.actor.height,
+ Tweener.addTween(this._notificationBin,
+ { opacity: 255,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad' });
+
+ let tweenParams = { y: 0,
time: ANIMATION_TIME,
- transition: 'easeOutQuad',
+ transition: 'easeOutBack',
onComplete: this._showNotificationCompleted,
onCompleteScope: this
};
- this._tween(this.actor, '_notificationState', State.SHOWN, tweenParams);
+ this._tween(this._notificationBin, '_notificationState', State.SHOWN, tweenParams);
},
_showNotificationCompleted: function() {
@@ -1953,18 +1952,20 @@ const MessageTray = new Lang.Class({
this._resetNotificationLeftTimeout();
if (animate) {
- this._tween(this.actor, '_notificationState', State.HIDDEN,
- { y: 0,
- opacity: 0,
+ Tweener.addTween(this._notificationBin,
+ { opacity: 0,
+ time: ANIMATION_TIME,
+ transition: 'easeOutQuad' });
+ this._tween(this._notificationBin, '_notificationState', State.HIDDEN,
+ { y: -this._notificationBin.height,
time: ANIMATION_TIME,
- transition: 'easeOutQuad',
+ transition: 'easeOutBack',
onComplete: this._hideNotificationCompleted,
onCompleteScope: this
});
} else {
- Tweener.removeTweens(this.actor);
- this.actor.y = 0;
- this.actor.opacity = 0;
+ Tweener.removeTweens(this._notificationBin);
+ this._notificationBin.y = -this._notificationBin.height;
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
}
@@ -1981,7 +1982,6 @@ const MessageTray = new Lang.Class({
this._pointerInNotification = false;
this._notificationRemoved = false;
this._notificationBin.child = null;
- this.actor.hide();
},
_expandActiveNotification: function() {
@@ -1992,10 +1992,6 @@ const MessageTray = new Lang.Class({
},
_expandNotification: function(autoExpanding) {
- if (!this._notificationExpandedId)
- this._notificationExpandedId =
- this._notification.connect('expanded',
- Lang.bind(this, this._onNotificationExpanded));
// Don't animate changes in notifications that are auto-expanding.
this._notification.expand(!autoExpanding);
@@ -2004,30 +2000,6 @@ const MessageTray = new Lang.Class({
this._ensureNotificationFocused();
},
- _onNotificationExpanded: function() {
- let expandedY = - this.actor.height;
-
- // Don't animate the notification to its new position if it has shrunk:
- // there will be a very visible "gap" that breaks the illusion.
- if (this.actor.y < expandedY) {
- this.actor.y = expandedY;
- } else if (this._notification.y != expandedY) {
- // Tween also opacity here, to override a possible tween that's
- // currently hiding the notification.
- Tweener.addTween(this.actor,
- { y: expandedY,
- opacity: 255,
- time: ANIMATION_TIME,
- transition: 'easeOutQuad',
- // HACK: Drive the state machine here better,
- // instead of overwriting tweens
- onComplete: Lang.bind(this, function() {
- this._notificationState = State.SHOWN;
- }),
- });
- }
- },
-
_ensureNotificationFocused: function() {
this._notificationFocusGrabber.grabFocus();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]