[the-board/cheese: 6/10] [things] Pack photo texture in an surrounding content box



commit 4132d9696e8aba8cdaec820ba77bff61fbf69b88
Author: Lucas Rocha <lucasr gnome org>
Date:   Sun Apr 3 12:07:57 2011 +0100

    [things] Pack photo texture in an surrounding content box
    
    This way we can pack overlays on top of the texture using the same
    allocation.

 src/js/ui/things/photo.js |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/js/ui/things/photo.js b/src/js/ui/things/photo.js
index 5d0c373..d841453 100644
--- a/src/js/ui/things/photo.js
+++ b/src/js/ui/things/photo.js
@@ -69,6 +69,7 @@ PhotoThing.prototype = {
         this._style.load_from_file(STYLE);
 
         this._createPhotoBox();
+        this._createContentBox();
         this._createPhoto();
         this._createCaptionText();
         this._createTapes();
@@ -85,13 +86,23 @@ PhotoThing.prototype = {
                                name: "photo-thing-photo-box" });
     },
 
+    _createContentBox : function() {
+        this._contentBox =
+            new TheBoard.Box({ orientation: TheBoard.BoxOrientation.VERTICAL,
+                               xAlign: TheBoard.BoxAlignment.FILL,
+                               yAlign: TheBoard.BoxAlignment.FILL });
+
+        this._photoBox.append(this._contentBox,
+                              TheBoard.BoxPackFlags.EXPAND);
+    },
+
     _createPhoto : function() {
         this._photo =
             new Clutter.Texture({ keepAspectRatio: true,
                                   loadAsync: true });
 
-        this._photoBox.append(this._photo,
-                              TheBoard.BoxPackFlags.EXPAND);
+        this._contentBox.append(this._photo,
+                                TheBoard.BoxPackFlags.EXPAND);
     },
 
     _createCaptionText : function() {



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