[gnome-boxes] notificationbar: Move notifications to display when visible



commit 9d5ff8c8f2956e04a704b6ed8b7c9aba6a1dba65
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Oct 29 21:49:32 2012 +0100

    notificationbar: Move notifications to display when visible
    
    We create the notifications in the right tab (display or
    in the main ui), and we move them there when we switch tabs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679106

 src/notificationbar.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/notificationbar.vala b/src/notificationbar.vala
index 1398da4..302a787 100644
--- a/src/notificationbar.vala
+++ b/src/notificationbar.vala
@@ -25,6 +25,14 @@ private class Boxes.Notificationbar: GLib.Object {
         Gdk.RGBA transparent = { 0, 0, 0, 0};
         gtk_actor.get_widget ().override_background_color (0, transparent);
 
+        App.app.notebook.notify["page"].connect ( () => {
+            foreach (var w in active_notifications) {
+                var parent = w.get_parent () as Container;
+                if (parent != null)
+                    parent.remove (w);
+                add_notification (w);
+            }
+        });
     }
 
     public void display_for_action (string            message,
@@ -45,7 +53,10 @@ private class Boxes.Notificationbar: GLib.Object {
     }
 
     private void add_notification (Widget w) {
-        top_grid.attach (w, 0, 0, 1, 1);
+        if (App.app.notebook.page == AppPage.MAIN)
+            top_grid.attach (w, 0, 0, 1, 1);
+        else
+            App.app.display_page.add_notification (w);
     }
 
     private void display (string            message,



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