[banshee] [AlbumListView] Fix layout for non-square albums



commit d3af04728769b05248c159d10c2b66b85e4b1089
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Sat Apr 17 12:02:03 2010 +1000

    [AlbumListView] Fix layout for non-square albums

 .../Banshee.Collection.Gui/DataViewChildAlbum.cs   |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DataViewChildAlbum.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DataViewChildAlbum.cs
index 43eda16..80fbd14 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DataViewChildAlbum.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DataViewChildAlbum.cs
@@ -124,13 +124,14 @@ namespace Banshee.Collection.Gui
                 image_allocation.Y = Math.Round ((inner_allocation.Height - height) / 2.0);
             }
 
+            double allocated_image_size = Math.Max (image_allocation.Height, image_allocation.Width);
             if (IsGridLayout) {
-                first_line_allocation.Y = image_allocation.Height + ImageSpacing;
+                first_line_allocation.Y = allocated_image_size + ImageSpacing;
                 first_line_allocation.Width = second_line_allocation.Width = inner_allocation.Width;
             } else {
-                first_line_allocation.X = second_line_allocation.X = image_allocation.Width + ImageSpacing;
+                first_line_allocation.X = second_line_allocation.X = allocated_image_size + ImageSpacing;
                 first_line_allocation.Width = second_line_allocation.Width =
-                    inner_allocation.Width - image_allocation.Width - ImageSpacing;
+                    inner_allocation.Width - allocated_image_size - ImageSpacing;
             }
 
             second_line_allocation.Y = first_line_allocation.Bottom + TextSpacing;



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