[gnome-documents] notifications: don't use GdNotification



commit 53fc7f9017f3943a6a19be7a03881a301dcc219d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Nov 27 13:16:51 2016 +0100

    notifications: don't use GdNotification
    
    These days we can just use a GtkRevealer with the right style class.

 src/notifications.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/notifications.js b/src/notifications.js
index 4a8a7ee..a355365 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -327,17 +327,20 @@ const IndexingNotification = new Lang.Class({
 
 const NotificationManager = new Lang.Class({
     Name: 'NotificationManager',
-    Extends: Gd.Notification,
+    Extends: Gtk.Revealer,
 
     _init: function() {
-        this.parent({ timeout: -1,
-                      show_close_button: false,
-                      halign: Gtk.Align.CENTER,
+        this.parent({ halign: Gtk.Align.CENTER,
                       valign: Gtk.Align.START });
+
+        let frame = new Gtk.Frame();
+        frame.get_style_context().add_class('app-notification');
+        this.add(frame);
+
         this._grid = new Gtk.Grid({ orientation: Gtk.Orientation.VERTICAL,
                                     row_spacing: 6 });
 
-        this.add(this._grid);
+        frame.add(this._grid);
 
         // add indexing monitor notification
         this._indexingNotification = new IndexingNotification();
@@ -348,13 +351,14 @@ const NotificationManager = new Lang.Class({
         notification.widget.connect('destroy', Lang.bind(this, this._onWidgetDestroy));
 
         this.show_all();
+        this.reveal_child = true;
     },
 
     _onWidgetDestroy: function() {
         let children = this._grid.get_children();
 
         if (children.length == 0)
-            this.hide();
+            this.reveal_child = false;
     }
 });
 Signals.addSignalMethods(NotificationManager.prototype);


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