[gnome-shell/wip/fmuellner/notification-redux+sass: 191/207] calendar: Remove NotificationBanner



commit 393f431edb662deb292537261177825eba4f04d8
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 17 02:52:32 2015 +0100

    calendar: Remove NotificationBanner
    
    It makes more sense in MessageTray

 js/ui/calendar.js |   88 -----------------------------------------------------
 1 files changed, 0 insertions(+), 88 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index b570551..585fe5b 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1334,94 +1334,6 @@ const NotificationMessage = new Lang.Class({
     }
 });
 
-const NotificationBanner = new Lang.Class({
-    Name: 'NotificationBanner',
-    Extends: NotificationMessage,
-
-    _init: function(notification) {
-        this._noDate = true;
-
-        this.parent(notification);
-
-        this.actor.add_style_class_name('notification-banner');
-
-        this.actor.set_x_expand(false);
-        this.actor.set_y_expand(true);
-        this.actor.set_y_align(Clutter.ActorAlign.START);
-
-        this._expanded = false;
-        this.bodyLabel.clutter_text.line_wrap = true;
-
-        this._actionBin = new St.Widget({ layout_manager: new ScaleLayout(),
-                                          visible: false });
-        this._grid.layout_manager.attach_next_to(this._actionBin, null,
-                                                 Clutter.GridPosition.BOTTOM, 4, 1);
-
-        for (let button of notification.buttons)
-            this._addButton(button.label, button.callback);
-    },
-
-    _sync: function() {
-        this.parent();
-
-        if (this._expanded !== undefined)
-            this.expanded = this.actor.hover;
-    },
-
-    _addButton: function(label, callback) {
-        let buttonBox = this._actionBin.get_first_child();
-        if (!buttonBox) {
-            buttonBox = new St.BoxLayout({ style_class: 'notification-button-box',
-                                           x_expand: true });
-            this._actionBin.add_actor(buttonBox);
-        }
-
-        if (buttonBox.get_n_children() >= MAX_NOTIFICATION_BUTTONS)
-            return;
-
-        let button = new St.Button({ label: label,
-                                     style_class: 'notification-button',
-                                     x_expand: true });
-        button.connect('clicked', Lang.bind(this,
-            function() {
-                callback();
-
-                this.actor.destroy();
-            }));
-        buttonBox.add_actor(button);
-    },
-
-    set expanded(v) {
-        if (this._expanded === v)
-            return;
-
-        this._expanded = v;
-
-        let forWidth = this.bodyLabel.clutter_text.width;
-        let [, lineHeight] = 
-            this.bodyLabel.clutter_text.get_preferred_height (-1);
-
-        let height, scale;
-        if (this._expanded) {
-            let [, natHeight] =
-                this.bodyLabel.clutter_text.get_preferred_height (forWidth);
-            height = Math.min(6 * lineHeight, natHeight);
-
-            this._actionBin.scale_y = 0;
-            scale = 1.0;
-        } else {
-            height = lineHeight;
-            this._actionBin.scale_y = 1;
-            scale = 0.0;
-        }
-
-        this._actionBin.show();
-        Tweener.addTween(this.bodyLabel, { height: height, time: 0.2, transition: 'easeOutQuad' });
-        Tweener.addTween(this._actionBin, { scale_y: scale, time: 0.2, transition: 'easeOutQuad',
-                                            onComplete: Lang.bind(this, function() { if (!this._expanded) 
this._actionBin.hide(); }) });
-    }
-});
-
 const NotificationSection = new Lang.Class({
     Name: 'NotificationSection',
     Extends: MessageListSection,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]