[gnome-boxes] Put the dark background inside clutter



commit 78fdb4ec8119bca57042bbf95648d2cb4cb6fa09
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 7 20:49:34 2012 +0200

    Put the dark background inside clutter
    
    We make most main actors have a transparent background, then
    we add a clutter actor at the bottom of the stage with the dark background.
    This means we see background everywhere, even e.g. under the sidebar, so
    that we can e.g. properly scroll it in and have a shadow cast by it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677274

 data/gtk-style.css |   16 ++++------------
 src/app.vala       |   12 ++++++++++++
 2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index 0eb9a53..faca587 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -17,19 +17,11 @@
     -GtkWidget-separator-height: 1;
 }
 
-.view {
-    background-color: @boxes_bg_color;
-/*
-  this is broken in clutter-gtk? atm
-  background-image: url("assets/boxes-dark.png");
-  background-repeat: repeat;
-*/
-}
-
+.view,
+GtkClutterOffscreen,
 .boxes-bg {
-    background-color: @boxes_bg_color;
-    background-image: url("assets/boxes-dark.png");
-    background-repeat: repeat;
+    background-color: transparent;
+    background-image: none;
 }
 
 .boxes-sidebar-bg {
diff --git a/src/app.vala b/src/app.vala
index 0447683..a704999 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -377,6 +377,18 @@ private class Boxes.App: Boxes.UI {
         stage.set_layout_manager (stage_bin);
         stage.name = "boxes-stage";
 
+        var background = new GtkClutter.Texture ();
+        background.name = "background";
+        try {
+            var pixbuf = new Gdk.Pixbuf.from_file (get_style ("assets/boxes-dark.png"));
+            background.set_from_pixbuf (pixbuf);
+        } catch (GLib.Error e) {
+        }
+        background.set_repeat (true, true);
+        stage_bin.add (background,
+                       Clutter.BinAlignment.FILL,
+                       Clutter.BinAlignment.FILL);
+
         sidebar = new Sidebar ();
         view = new CollectionView (sidebar.category);
         topbar = new Topbar ();



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