[gnome-shell/wip/fmuellner/notification-redux+sass: 126/145] messageTray: Record actions added to notifications



commit 17f1726f3587b91d739654aa16a58c34b00cff9c
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 4f03d06..d5a6073 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');
@@ -817,6 +819,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]