[gnome-shell/wip/fmuellner/notification-redux+sass: 132/141] messageTray: Record actions added to notifications
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/notification-redux+sass: 132/141] messageTray: Record actions added to notifications
- Date: Thu, 19 Feb 2015 21:05:57 +0000 (UTC)
commit 293abec9634d0b2f8bb7196c9500928b1a564d25
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 19 13:45:31 2015 +0100
messageTray: Record actions added to notifications
Both the screen shield and the notification section in the message
list create their own UI for notifications rather than using the
notification actor itself. Currently there is no clean way for such
representations to include notification actions - we will need this
as we will soon use a separate actor for banners as well, so keep
track of actions added via addAction().
js/ui/messageTray.js | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 4a1b056..78e6de3 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -495,6 +495,7 @@ const Notification = new Lang.Class({
this._soundName = null;
this._soundFile = null;
this._soundPlayed = false;
+ this.actions = [];
this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION });
this.actor.add_style_class_name('notification-unexpanded');
@@ -594,6 +595,7 @@ const Notification = new Lang.Class({
this._actionArea.destroy();
this._actionArea = null;
this._buttonBox = null;
+ this.actions = [];
}
if (!this._scrollArea && !this._actionArea)
this._table.remove_style_class_name('multi-line-notification');
@@ -818,6 +820,7 @@ const Notification = new Lang.Class({
// action buttons will appear in a single row at the bottom of
// the notification.
addAction: function(label, callback) {
+ this.actions.push({ label: label, callback: callback });
let button = new St.Button({ style_class: 'notification-button',
label: label,
can_focus: true });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]