[gnome-shell] panel: Move notification banners below time+date dropdown
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] panel: Move notification banners below time+date dropdown
- Date: Sat, 25 Apr 2015 07:56:56 +0000 (UTC)
commit 674325e96ccbf3aafbaf158be5743fb17884baa7
Author: Meet Parikh <meetprkh gnome gmail com>
Date: Thu Apr 23 16:13:03 2015 +0530
panel: Move notification banners below time+date dropdown
As notifications appear in the time+date dropdown's message list, there's
a strong relationship between notification banners and the menu. However
while the time+date menu is centered by default, which matches the banner
position, its actual position depends on the session mode - in particular
it is moved to the right in classic mode.
Reinforce the relationship in these cases by moving notification banners
underneath the time+date menu.
https://bugzilla.gnome.org/show_bug.cgi?id=745910
js/ui/messageTray.js | 8 ++++++++
js/ui/panel.js | 8 ++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 7d2c3c8..4a949d4 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -976,6 +976,14 @@ const MessageTray = new Lang.Class({
Shell.util_set_hidden_from_pick(this.actor, false);
},
+ get bannerAlignment() {
+ return this._bannerBin.get_x_align();
+ },
+
+ set bannerAlignment(align) {
+ this._bannerBin.set_x_align(align);
+ },
+
_onNotificationKeyRelease: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape && event.get_state() == 0) {
this._expireNotification();
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 8e7fa3e..2a95136 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -933,6 +933,14 @@ const Panel = new Lang.Class({
this._updateBox(panel.center, this._centerBox);
this._updateBox(panel.right, this._rightBox);
+ if (panel.left.indexOf('dateMenu') != -1)
+ Main.messageTray.bannerAlignment = Clutter.ActorAlign.START;
+ else if (panel.right.indexOf('dateMenu') != -1)
+ Main.messageTray.bannerAlignment = Clutter.ActorAlign.END;
+ // Default to center if there is no dateMenu
+ else
+ Main.messageTray.bannerAlignment = Clutter.ActorAlign.CENTER;
+
if (this._sessionStyle)
this._removeStyleClassName(this._sessionStyle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]