[gnome-shell/wip/fmuellner/notification-redux+sass: 115/122] messageTray: Limit number of buttons in banners
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/notification-redux+sass: 115/122] messageTray: Limit number of buttons in banners
- Date: Tue, 17 Feb 2015 15:13:38 +0000 (UTC)
commit e2938a3bd822503f39de7844876d92515fc143cb
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Feb 17 03:53:00 2015 +0100
messageTray: Limit number of buttons in banners
js/ui/messageTray.js | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 6fe98bd..2927b2d 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -32,6 +32,7 @@ const LONGER_HIDE_TIMEOUT = 0.6;
const MAX_NOTIFICATIONS_PER_SOURCE = 3;
const MAX_NOTIFICATIONS_IN_QUEUE = 3;
+const MAX_NOTIFICATION_BUTTONS = 3;
// We delay hiding of the tray if the mouse is within MOUSE_LEFT_ACTOR_THRESHOLD
// range from the point where it left the tray.
@@ -539,6 +540,9 @@ const NotificationBanner = new Lang.Class({
global.focus_manager.add_group(this._buttonBox);
}
+ if (this._buttonBox.get_n_children() >= MAX_NOTIFICATION_BUTTONS)
+ return null;
+
this._buttonBox.add(button);
button.connect('clicked', Lang.bind(this, function() {
callback();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]